1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/netwerk/sctp/src/netinet/sctp_output.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,262 @@ 1.4 +/*- 1.5 + * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. 1.6 + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. 1.7 + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. 1.8 + * 1.9 + * Redistribution and use in source and binary forms, with or without 1.10 + * modification, are permitted provided that the following conditions are met: 1.11 + * 1.12 + * a) Redistributions of source code must retain the above copyright notice, 1.13 + * this list of conditions and the following disclaimer. 1.14 + * 1.15 + * b) Redistributions in binary form must reproduce the above copyright 1.16 + * notice, this list of conditions and the following disclaimer in 1.17 + * the documentation and/or other materials provided with the distribution. 1.18 + * 1.19 + * c) Neither the name of Cisco Systems, Inc. nor the names of its 1.20 + * contributors may be used to endorse or promote products derived 1.21 + * from this software without specific prior written permission. 1.22 + * 1.23 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1.24 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 1.25 + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1.26 + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 1.27 + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 1.28 + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 1.29 + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 1.30 + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 1.31 + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 1.32 + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 1.33 + * THE POSSIBILITY OF SUCH DAMAGE. 1.34 + */ 1.35 + 1.36 +#ifdef __FreeBSD__ 1.37 +#include <sys/cdefs.h> 1.38 +__FBSDID("$FreeBSD: head/sys/netinet/sctp_output.h 246595 2013-02-09 17:26:14Z tuexen $"); 1.39 +#endif 1.40 + 1.41 +#ifndef _NETINET_SCTP_OUTPUT_H_ 1.42 +#define _NETINET_SCTP_OUTPUT_H_ 1.43 + 1.44 +#include <netinet/sctp_header.h> 1.45 + 1.46 +#if defined(_KERNEL) || defined(__Userspace__) 1.47 + 1.48 + 1.49 +struct mbuf * 1.50 +sctp_add_addresses_to_i_ia(struct sctp_inpcb *inp, 1.51 + struct sctp_tcb *stcb, 1.52 + struct sctp_scoping *scope, 1.53 + struct mbuf *m_at, 1.54 + int cnt_inits_to, 1.55 + uint16_t *padding_len, uint16_t *chunk_len); 1.56 + 1.57 + 1.58 +int sctp_is_addr_restricted(struct sctp_tcb *, struct sctp_ifa *); 1.59 + 1.60 + 1.61 +int 1.62 +sctp_is_address_in_scope(struct sctp_ifa *ifa, 1.63 + struct sctp_scoping *scope, 1.64 + int do_update); 1.65 + 1.66 +int 1.67 +sctp_is_addr_in_ep(struct sctp_inpcb *inp, struct sctp_ifa *ifa); 1.68 + 1.69 +struct sctp_ifa * 1.70 +sctp_source_address_selection(struct sctp_inpcb *inp, 1.71 + struct sctp_tcb *stcb, 1.72 + sctp_route_t *ro, struct sctp_nets *net, 1.73 + int non_asoc_addr_ok, uint32_t vrf_id); 1.74 + 1.75 +#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__Userspace__) 1.76 +int 1.77 +sctp_v6src_match_nexthop(struct sockaddr_in6 *src6, sctp_route_t *ro); 1.78 +int 1.79 +sctp_v4src_match_nexthop(struct sctp_ifa *sifa, sctp_route_t *ro); 1.80 +#endif 1.81 + 1.82 +void sctp_send_initiate(struct sctp_inpcb *, struct sctp_tcb *, int 1.83 +#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) 1.84 + SCTP_UNUSED 1.85 +#endif 1.86 + ); 1.87 + 1.88 +void 1.89 +sctp_send_initiate_ack(struct sctp_inpcb *, struct sctp_tcb *, struct mbuf *, 1.90 + int, int, 1.91 + struct sockaddr *, struct sockaddr *, 1.92 + struct sctphdr *, struct sctp_init_chunk *, 1.93 +#if defined(__FreeBSD__) 1.94 + uint8_t, uint32_t, 1.95 +#endif 1.96 + uint32_t, uint16_t, int); 1.97 + 1.98 +struct mbuf * 1.99 +sctp_arethere_unrecognized_parameters(struct mbuf *, int, int *, 1.100 + struct sctp_chunkhdr *, int *); 1.101 +void sctp_queue_op_err(struct sctp_tcb *, struct mbuf *); 1.102 + 1.103 +int 1.104 +sctp_send_cookie_echo(struct mbuf *, int, struct sctp_tcb *, 1.105 + struct sctp_nets *); 1.106 + 1.107 +void sctp_send_cookie_ack(struct sctp_tcb *); 1.108 + 1.109 +void 1.110 +sctp_send_heartbeat_ack(struct sctp_tcb *, struct mbuf *, int, int, 1.111 + struct sctp_nets *); 1.112 + 1.113 +void 1.114 +sctp_remove_from_wheel(struct sctp_tcb *stcb, 1.115 + struct sctp_association *asoc, 1.116 + struct sctp_stream_out *strq, int holds_lock); 1.117 + 1.118 + 1.119 +void sctp_send_shutdown(struct sctp_tcb *, struct sctp_nets *); 1.120 + 1.121 +void sctp_send_shutdown_ack(struct sctp_tcb *, struct sctp_nets *); 1.122 + 1.123 +void sctp_send_shutdown_complete(struct sctp_tcb *, struct sctp_nets *, int); 1.124 + 1.125 +void sctp_send_shutdown_complete2(struct sockaddr *, struct sockaddr *, 1.126 + struct sctphdr *, 1.127 +#if defined(__FreeBSD__) 1.128 + uint8_t, uint32_t, 1.129 +#endif 1.130 + uint32_t, uint16_t); 1.131 + 1.132 +void sctp_send_asconf(struct sctp_tcb *, struct sctp_nets *, int addr_locked); 1.133 + 1.134 +void sctp_send_asconf_ack(struct sctp_tcb *); 1.135 + 1.136 +int sctp_get_frag_point(struct sctp_tcb *, struct sctp_association *); 1.137 + 1.138 +void sctp_toss_old_cookies(struct sctp_tcb *, struct sctp_association *); 1.139 + 1.140 +void sctp_toss_old_asconf(struct sctp_tcb *); 1.141 + 1.142 +void sctp_fix_ecn_echo(struct sctp_association *); 1.143 + 1.144 +void sctp_move_chunks_from_net(struct sctp_tcb *stcb, struct sctp_nets *net); 1.145 + 1.146 +#if defined(__FreeBSD__) && __FreeBSD_version >= 500000 1.147 +int 1.148 +sctp_output(struct sctp_inpcb *, struct mbuf *, struct sockaddr *, 1.149 + struct mbuf *, struct thread *, int); 1.150 +#elif defined(__Windows__) 1.151 +sctp_output(struct sctp_inpcb *, struct mbuf *, struct sockaddr *, 1.152 + struct mbuf *, PKTHREAD, int); 1.153 +#else 1.154 +#if defined(__Userspace__) 1.155 +/* sctp_output is called bu sctp_sendm. Not using sctp_sendm for __Userspace__ */ 1.156 +#endif 1.157 +int 1.158 +sctp_output(struct sctp_inpcb *, 1.159 +#if defined(__Panda__) 1.160 + pakhandle_type, 1.161 +#else 1.162 + struct mbuf *, 1.163 +#endif 1.164 + struct sockaddr *, 1.165 +#if defined(__Panda__) 1.166 + pakhandle_type, 1.167 +#else 1.168 + struct mbuf *, 1.169 +#endif 1.170 + struct proc *, int); 1.171 +#endif 1.172 + 1.173 +void sctp_chunk_output(struct sctp_inpcb *, struct sctp_tcb *, int, int 1.174 +#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) 1.175 + SCTP_UNUSED 1.176 +#endif 1.177 + ); 1.178 +void sctp_send_abort_tcb(struct sctp_tcb *, struct mbuf *, int 1.179 +#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) 1.180 + SCTP_UNUSED 1.181 +#endif 1.182 + ); 1.183 + 1.184 +void send_forward_tsn(struct sctp_tcb *, struct sctp_association *); 1.185 + 1.186 +void sctp_send_sack(struct sctp_tcb *, int); 1.187 + 1.188 +void sctp_send_hb(struct sctp_tcb *, struct sctp_nets *, int); 1.189 + 1.190 +void sctp_send_ecn_echo(struct sctp_tcb *, struct sctp_nets *, uint32_t); 1.191 + 1.192 + 1.193 +void 1.194 +sctp_send_packet_dropped(struct sctp_tcb *, struct sctp_nets *, struct mbuf *, 1.195 + int, int, int); 1.196 + 1.197 + 1.198 + 1.199 +void sctp_send_cwr(struct sctp_tcb *, struct sctp_nets *, uint32_t, uint8_t); 1.200 + 1.201 + 1.202 +void 1.203 +sctp_add_stream_reset_out(struct sctp_tmit_chunk *, 1.204 + int, uint16_t *, uint32_t, uint32_t, uint32_t); 1.205 + 1.206 +void 1.207 +sctp_add_stream_reset_result(struct sctp_tmit_chunk *, uint32_t, uint32_t); 1.208 + 1.209 +void 1.210 +sctp_add_stream_reset_result_tsn(struct sctp_tmit_chunk *, 1.211 + uint32_t, uint32_t, uint32_t, uint32_t); 1.212 + 1.213 +int 1.214 +sctp_send_str_reset_req(struct sctp_tcb *, int , uint16_t *, uint8_t, uint8_t, 1.215 + uint8_t, uint8_t, uint16_t, uint16_t, uint8_t); 1.216 + 1.217 +void 1.218 +sctp_send_abort(struct mbuf *, int, struct sockaddr *, struct sockaddr *, 1.219 + struct sctphdr *, uint32_t, struct mbuf *, 1.220 +#if defined(__FreeBSD__) 1.221 + uint8_t, uint32_t, 1.222 +#endif 1.223 + uint32_t, uint16_t); 1.224 + 1.225 +void sctp_send_operr_to(struct sockaddr *, struct sockaddr *, 1.226 + struct sctphdr *, uint32_t, struct mbuf *, 1.227 +#if defined(__FreeBSD__) 1.228 + uint8_t, uint32_t, 1.229 +#endif 1.230 + uint32_t, uint16_t); 1.231 + 1.232 +#endif /* _KERNEL || __Userspace__ */ 1.233 + 1.234 +#if defined(_KERNEL) || defined(__Userspace__) 1.235 +int 1.236 +sctp_sosend(struct socket *so, 1.237 + struct sockaddr *addr, 1.238 + struct uio *uio, 1.239 +#ifdef __Panda__ 1.240 + pakhandle_type top, 1.241 + pakhandle_type control, 1.242 +#else 1.243 + struct mbuf *top, 1.244 + struct mbuf *control, 1.245 +#endif 1.246 +#if defined(__APPLE__) || defined(__Panda__) 1.247 + int flags 1.248 +#else 1.249 + int flags, 1.250 +#if defined(__FreeBSD__) && __FreeBSD_version >= 500000 1.251 + struct thread *p 1.252 +#elif defined(__Windows__) 1.253 + PKTHREAD p 1.254 +#else 1.255 +#if defined(__Userspace__) 1.256 + /* proc is a dummy in __Userspace__ and will not be passed to sctp_lower_sosend */ 1.257 +#endif 1.258 + struct proc *p 1.259 +#endif 1.260 +#endif 1.261 +); 1.262 + 1.263 +#endif 1.264 +#endif 1.265 +