1/*-
2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1994, 1995
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 13 unchanged lines hidden (view full) ---
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * @(#)tcp_input.c 8.12 (Berkeley) 5/24/95
30 * $FreeBSD: head/sys/netinet/tcp_reass.c 157609 2006-04-09 16:59:19Z rwatson $
31 */
32
33#include "opt_ipfw.h" /* for ipfw_fwd */
34#include "opt_inet.h"
35#include "opt_inet6.h"
36#include "opt_ipsec.h"
37#include "opt_mac.h"
38#include "opt_tcpdebug.h"
--- 158 unchanged lines hidden (view full) ---
197 * - this is a half-synchronized T/TCP connection.
198 */
199#define DELAY_ACK(tp) \
200 ((!callout_active(tp->tt_delack) && \
201 (tp->t_flags & TF_RXWIN0SENT) == 0) && \
202 (tcp_delack_enabled || (tp->t_flags & TF_NEEDSYN)))
203
204/* Initialize TCP reassembly queue */
205uma_zone_t tcp_reass_zone;
206void
207tcp_reass_init()
208{
209 tcp_reass_maxseg = nmbclusters / 16;
210 TUNABLE_INT_FETCH("net.inet.tcp.reass.maxsegments",
211 &tcp_reass_maxseg);
212 tcp_reass_zone = uma_zcreate("tcpreass", sizeof (struct tseg_qent),
213 NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
214 uma_zone_set_max(tcp_reass_zone, tcp_reass_maxseg);
215}
216
217static int
218tcp_reass(tp, th, tlenp, m)
219 register struct tcpcb *tp;
220 register struct tcphdr *th;
221 int *tlenp;
222 struct mbuf *m;
--- 3058 unchanged lines hidden ---
2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1994, 1995
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 13 unchanged lines hidden (view full) ---
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * @(#)tcp_input.c 8.12 (Berkeley) 5/24/95
30 * $FreeBSD: head/sys/netinet/tcp_reass.c 157609 2006-04-09 16:59:19Z rwatson $
31 */
32
33#include "opt_ipfw.h" /* for ipfw_fwd */
34#include "opt_inet.h"
35#include "opt_inet6.h"
36#include "opt_ipsec.h"
37#include "opt_mac.h"
38#include "opt_tcpdebug.h"
--- 158 unchanged lines hidden (view full) ---
197 * - this is a half-synchronized T/TCP connection.
198 */
199#define DELAY_ACK(tp) \
200 ((!callout_active(tp->tt_delack) && \
201 (tp->t_flags & TF_RXWIN0SENT) == 0) && \
202 (tcp_delack_enabled || (tp->t_flags & TF_NEEDSYN)))
203
204/* Initialize TCP reassembly queue */
205uma_zone_t tcp_reass_zone;
206void
207tcp_reass_init()
208{
209 tcp_reass_maxseg = nmbclusters / 16;
210 TUNABLE_INT_FETCH("net.inet.tcp.reass.maxsegments",
211 &tcp_reass_maxseg);
212 tcp_reass_zone = uma_zcreate("tcpreass", sizeof (struct tseg_qent),
213 NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
214 uma_zone_set_max(tcp_reass_zone, tcp_reass_maxseg);
215}
216
217static int
218tcp_reass(tp, th, tlenp, m)
219 register struct tcpcb *tp;
220 register struct tcphdr *th;
221 int *tlenp;
222 struct mbuf *m;
--- 3058 unchanged lines hidden ---