xref: /openbsd-src/sys/netinet/tcp_var.h (revision db3296cf5c1dd9058ceecc3a29fe4aaa0bd26000)
1 /*	$OpenBSD: tcp_var.h,v 1.51 2003/06/09 07:40:25 itojun Exp $	*/
2 /*	$NetBSD: tcp_var.h,v 1.17 1996/02/13 23:44:24 christos Exp $	*/
3 
4 /*
5  * Copyright (c) 1982, 1986, 1993, 1994
6  *	The Regents of the University of California.  All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  * 1. Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in the
15  *    documentation and/or other materials provided with the distribution.
16  * 3. Neither the name of the University nor the names of its contributors
17  *    may be used to endorse or promote products derived from this software
18  *    without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30  * SUCH DAMAGE.
31  *
32  *	@(#)tcp_var.h	8.3 (Berkeley) 4/10/94
33  */
34 
35 #ifndef _NETINET_TCP_VAR_H_
36 #define _NETINET_TCP_VAR_H_
37 
38 struct sackblk {
39 	tcp_seq start;		/* start seq no. of sack block */
40 	tcp_seq end; 		/* end seq no. */
41 };
42 
43 struct sackhole {
44 	tcp_seq start;		/* start seq no. of hole */
45 	tcp_seq end;		/* end seq no. */
46 	int	dups;		/* number of dup(s)acks for this hole */
47 	tcp_seq rxmit;		/* next seq. no in hole to be retransmitted */
48 	struct sackhole *next;	/* next in list */
49 };
50 
51 /*
52  * Kernel variables for tcp.
53  */
54 
55 /*
56  * Tcp control block, one per tcp; fields:
57  */
58 struct tcpcb {
59 	struct ipqehead segq;		/* sequencing queue */
60 	struct timeout t_timer[TCPT_NTIMERS];	/* tcp timers */
61 	short	t_state;		/* state of this connection */
62 	short	t_rxtshift;		/* log(2) of rexmt exp. backoff */
63 	short	t_rxtcur;		/* current retransmit value */
64 	short	t_dupacks;		/* consecutive dup acks recd */
65 	u_short	t_maxseg;		/* maximum segment size */
66 	char	t_force;		/* 1 if forcing out a byte */
67 	u_int	t_flags;
68 #define	TF_ACKNOW	0x0001		/* ack peer immediately */
69 #define	TF_DELACK	0x0002		/* ack, but try to delay it */
70 #define	TF_NODELAY	0x0004		/* don't delay packets to coalesce */
71 #define	TF_NOOPT	0x0008		/* don't use tcp options */
72 #define	TF_SENTFIN	0x0010		/* have sent FIN */
73 #define	TF_REQ_SCALE	0x0020		/* have/will request window scaling */
74 #define	TF_RCVD_SCALE	0x0040		/* other side has requested scaling */
75 #define	TF_REQ_TSTMP	0x0080		/* have/will request timestamps */
76 #define	TF_RCVD_TSTMP	0x0100		/* a timestamp was received in SYN */
77 #define	TF_SACK_PERMIT	0x0200		/* other side said I could SACK */
78 #define	TF_SIGNATURE	0x0400		/* require TCP MD5 signature */
79 #ifdef TCP_ECN
80 #define TF_ECN_PERMIT	0x00008000	/* other side said I could ECN */
81 #define TF_RCVD_CE	0x00010000	/* send ECE in subsequent segs */
82 #define TF_SEND_CWR	0x00020000	/* send CWR in next seg */
83 #define TF_DISABLE_ECN	0x00040000	/* disable ECN for this connection */
84 #endif
85 
86 	struct	mbuf *t_template;	/* skeletal packet for transmit */
87 	struct	inpcb *t_inpcb;		/* back pointer to internet pcb */
88 	struct	timeout t_delack_to;	/* delayed ACK callback */
89 /*
90  * The following fields are used as in the protocol specification.
91  * See RFC783, Dec. 1981, page 21.
92  */
93 /* send sequence variables */
94 	tcp_seq	snd_una;		/* send unacknowledged */
95 	tcp_seq	snd_nxt;		/* send next */
96 	tcp_seq	snd_up;			/* send urgent pointer */
97 	tcp_seq	snd_wl1;		/* window update seg seq number */
98 	tcp_seq	snd_wl2;		/* window update seg ack number */
99 	tcp_seq	iss;			/* initial send sequence number */
100 	u_long	snd_wnd;		/* send window */
101 #if 1 /*def TCP_SACK*/
102 	int	sack_disable;		/* disable SACK for this connection */
103 	int	snd_numholes;		/* number of holes seen by sender */
104 	struct sackhole *snd_holes;	/* linked list of holes (sorted) */
105 #if 1 /*defined(TCP_SACK) && defined(TCP_FACK)*/
106 	tcp_seq snd_fack;		/* for FACK congestion control */
107 	u_long	snd_awnd;		/* snd_nxt - snd_fack + */
108 					/* retransmitted data */
109 	int retran_data;		/* amount of outstanding retx. data  */
110 #endif /* TCP_FACK */
111 #endif /* TCP_SACK */
112 #if 1 /*defined(TCP_SACK) || defined(TCP_ECN)*/
113 	tcp_seq snd_last;		/* for use in fast recovery */
114 #endif
115 /* receive sequence variables */
116 	u_long	rcv_wnd;		/* receive window */
117 	tcp_seq	rcv_nxt;		/* receive next */
118 	tcp_seq	rcv_up;			/* receive urgent pointer */
119 	tcp_seq	irs;			/* initial receive sequence number */
120 #if 1 /*def TCP_SACK*/
121 	tcp_seq rcv_laststart;		/* start of last segment recd. */
122 	tcp_seq rcv_lastend;		/* end of ... */
123 	tcp_seq rcv_lastsack;		/* last seq number(+1) sack'd by rcv'r*/
124 	int	rcv_numsacks;		/* # distinct sack blks present */
125 	struct sackblk sackblks[MAX_SACK_BLKS]; /* seq nos. of sack blocks */
126 #endif
127 
128 /*
129  * Additional variables for this implementation.
130  */
131 /* receive variables */
132 	tcp_seq	rcv_adv;		/* advertised window */
133 /* retransmit variables */
134 	tcp_seq	snd_max;		/* highest sequence number sent;
135 					 * used to recognize retransmits
136 					 */
137 /* congestion control (for slow start, source quench, retransmit after loss) */
138 	u_long	snd_cwnd;		/* congestion-controlled window */
139 	u_long	snd_ssthresh;		/* snd_cwnd size threshhold for
140 					 * for slow start exponential to
141 					 * linear switch
142 					 */
143 	u_short	t_maxopd;		/* mss plus options */
144 	u_short	t_peermss;		/* peer's maximum segment size */
145 
146 /*
147  * transmit timing stuff.  See below for scale of srtt and rttvar.
148  * "Variance" is actually smoothed difference.
149  */
150 	uint32_t t_rcvtime;		/* time last segment received */
151 	uint32_t t_rtttime;		/* time we started measuring rtt */
152 	tcp_seq	t_rtseq;		/* sequence number being timed */
153 	short	t_srtt;			/* smoothed round-trip time */
154 	short	t_rttvar;		/* variance in round-trip time */
155 	u_short	t_rttmin;		/* minimum rtt allowed */
156 	u_long	max_sndwnd;		/* largest window peer has offered */
157 
158 /* out-of-band data */
159 	char	t_oobflags;		/* have some */
160 	char	t_iobc;			/* input character */
161 #define	TCPOOB_HAVEDATA	0x01
162 #define	TCPOOB_HADDATA	0x02
163 	short	t_softerror;		/* possible error not yet reported */
164 
165 /* RFC 1323 variables */
166 	u_char	snd_scale;		/* window scaling for send window */
167 	u_char	rcv_scale;		/* window scaling for recv window */
168 	u_char	request_r_scale;	/* pending window scaling */
169 	u_char	requested_s_scale;
170 	u_int32_t ts_recent;		/* timestamp echo data */
171 	u_int32_t ts_recent_age;		/* when last updated */
172 	tcp_seq	last_ack_sent;
173 
174 /* TUBA stuff */
175 	caddr_t	t_tuba_pcb;		/* next level down pcb for TCP over z */
176 
177 	int pf;
178 };
179 
180 #define	intotcpcb(ip)	((struct tcpcb *)(ip)->inp_ppcb)
181 #define	sototcpcb(so)	(intotcpcb(sotoinpcb(so)))
182 
183 #ifdef _KERNEL
184 extern int tcp_delack_ticks;
185 void	tcp_delack(void *);
186 
187 #define TCP_INIT_DELACK(tp)						\
188 	timeout_set(&(tp)->t_delack_to, tcp_delack, tp)
189 
190 #define TCP_RESTART_DELACK(tp)						\
191 	timeout_add(&(tp)->t_delack_to, tcp_delack_ticks)
192 
193 #define	TCP_SET_DELACK(tp)						\
194 do {									\
195 	if (((tp)->t_flags & TF_DELACK) == 0) {				\
196 		(tp)->t_flags |= TF_DELACK;				\
197 		TCP_RESTART_DELACK(tp);					\
198 	}								\
199 } while (/*CONSTCOND*/0)
200 
201 #define	TCP_CLEAR_DELACK(tp)						\
202 do {									\
203 	if ((tp)->t_flags & TF_DELACK) {				\
204 		(tp)->t_flags &= ~TF_DELACK;				\
205 		timeout_del(&(tp)->t_delack_to);			\
206 	}								\
207 } while (/*CONSTCOND*/0)
208 #endif /* _KERNEL */
209 
210 /*
211  * The smoothed round-trip time and estimated variance
212  * are stored as fixed point numbers scaled by the values below.
213  * For convenience, these scales are also used in smoothing the average
214  * (smoothed = (1/scale)sample + ((scale-1)/scale)smoothed).
215  * With these scales, srtt has 3 bits to the right of the binary point,
216  * and thus an "ALPHA" of 0.875.  rttvar has 2 bits to the right of the
217  * binary point, and is smoothed with an ALPHA of 0.75.
218  */
219 #define	TCP_RTT_SCALE		8	/* multiplier for srtt; 3 bits frac. */
220 #define	TCP_RTT_SHIFT		3	/* shift for srtt; 3 bits frac. */
221 #define	TCP_RTTVAR_SCALE	4	/* multiplier for rttvar; 2 bits */
222 #define	TCP_RTTVAR_SHIFT	2	/* multiplier for rttvar; 2 bits */
223 
224 /*
225  * The initial retransmission should happen at rtt + 4 * rttvar.
226  * Because of the way we do the smoothing, srtt and rttvar
227  * will each average +1/2 tick of bias.  When we compute
228  * the retransmit timer, we want 1/2 tick of rounding and
229  * 1 extra tick because of +-1/2 tick uncertainty in the
230  * firing of the timer.  The bias will give us exactly the
231  * 1.5 tick we need.  But, because the bias is
232  * statistical, we have to test that we don't drop below
233  * the minimum feasible timer (which is 2 ticks).
234  * This macro assumes that the value of TCP_RTTVAR_SCALE
235  * is the same as the multiplier for rttvar.
236  */
237 #define	TCP_REXMTVAL(tp) \
238 	((((tp)->t_srtt >> TCP_RTT_SHIFT) + (tp)->t_rttvar) >> 2)
239 
240 /*
241  * TCP statistics.
242  * Many of these should be kept per connection,
243  * but that's inconvenient at the moment.
244  */
245 struct	tcpstat {
246 	u_int32_t tcps_connattempt;	/* connections initiated */
247 	u_int32_t tcps_accepts;		/* connections accepted */
248 	u_int32_t tcps_connects;	/* connections established */
249 	u_int32_t tcps_drops;		/* connections dropped */
250 	u_int32_t tcps_conndrops;	/* embryonic connections dropped */
251 	u_int32_t tcps_closed;		/* conn. closed (includes drops) */
252 	u_int32_t tcps_segstimed;	/* segs where we tried to get rtt */
253 	u_int32_t tcps_rttupdated;	/* times we succeeded */
254 	u_int32_t tcps_delack;		/* delayed acks sent */
255 	u_int32_t tcps_timeoutdrop;	/* conn. dropped in rxmt timeout */
256 	u_int32_t tcps_rexmttimeo;	/* retransmit timeouts */
257 	u_int32_t tcps_persisttimeo;	/* persist timeouts */
258 	u_int32_t tcps_persistdrop;	/* connections dropped in persist */
259 	u_int32_t tcps_keeptimeo;	/* keepalive timeouts */
260 	u_int32_t tcps_keepprobe;	/* keepalive probes sent */
261 	u_int32_t tcps_keepdrops;	/* connections dropped in keepalive */
262 
263 	u_int32_t tcps_sndtotal;		/* total packets sent */
264 	u_int32_t tcps_sndpack;		/* data packets sent */
265 	u_int64_t tcps_sndbyte;		/* data bytes sent */
266 	u_int32_t tcps_sndrexmitpack;	/* data packets retransmitted */
267 	u_int64_t tcps_sndrexmitbyte;	/* data bytes retransmitted */
268 	u_int64_t tcps_sndrexmitfast;	/* Fast retransmits */
269 	u_int32_t tcps_sndacks;		/* ack-only packets sent */
270 	u_int32_t tcps_sndprobe;	/* window probes sent */
271 	u_int32_t tcps_sndurg;		/* packets sent with URG only */
272 	u_int32_t tcps_sndwinup;	/* window update-only packets sent */
273 	u_int32_t tcps_sndctrl;		/* control (SYN|FIN|RST) packets sent */
274 
275 	u_int32_t tcps_rcvtotal;	/* total packets received */
276 	u_int32_t tcps_rcvpack;		/* packets received in sequence */
277 	u_int64_t tcps_rcvbyte;		/* bytes received in sequence */
278 	u_int32_t tcps_rcvbadsum;	/* packets received with ccksum errs */
279 	u_int32_t tcps_rcvbadoff;	/* packets received with bad offset */
280 	u_int32_t tcps_rcvmemdrop;	/* packets dropped for lack of memory */
281 	u_int32_t tcps_rcvnosec;	/* packets dropped for lack of ipsec */
282 	u_int32_t tcps_rcvshort;	/* packets received too short */
283 	u_int32_t tcps_rcvduppack;	/* duplicate-only packets received */
284 	u_int64_t tcps_rcvdupbyte;	/* duplicate-only bytes received */
285 	u_int32_t tcps_rcvpartduppack;	/* packets with some duplicate data */
286 	u_int64_t tcps_rcvpartdupbyte;	/* dup. bytes in part-dup. packets */
287 	u_int32_t tcps_rcvoopack;	/* out-of-order packets received */
288 	u_int64_t tcps_rcvoobyte;	/* out-of-order bytes received */
289 	u_int32_t tcps_rcvpackafterwin;	/* packets with data after window */
290 	u_int64_t tcps_rcvbyteafterwin;	/* bytes rcvd after window */
291 	u_int32_t tcps_rcvafterclose;	/* packets rcvd after "close" */
292 	u_int32_t tcps_rcvwinprobe;	/* rcvd window probe packets */
293 	u_int32_t tcps_rcvdupack;	/* rcvd duplicate acks */
294 	u_int32_t tcps_rcvacktoomuch;	/* rcvd acks for unsent data */
295 	u_int32_t tcps_rcvackpack;	/* rcvd ack packets */
296 	u_int64_t tcps_rcvackbyte;	/* bytes acked by rcvd acks */
297 	u_int32_t tcps_rcvwinupd;	/* rcvd window update packets */
298 	u_int32_t tcps_pawsdrop;	/* segments dropped due to PAWS */
299 	u_int32_t tcps_predack;		/* times hdr predict ok for acks */
300 	u_int32_t tcps_preddat;		/* times hdr predict ok for data pkts */
301 
302 	u_int32_t tcps_pcbhashmiss;	/* input packets missing pcb hash */
303 	u_int32_t tcps_noport;		/* no socket on port */
304 	u_int32_t tcps_badsyn;		/* SYN packet with src==dst rcv'ed */
305 
306 	u_int32_t tcps_rcvbadsig;	/* rcvd bad/missing TCP signatures */
307 	u_int64_t tcps_rcvgoodsig;	/* rcvd good TCP signatures */
308 	u_int32_t tcps_inhwcsum;	/* input hardware-checksummed packets */
309 	u_int32_t tcps_outhwcsum;	/* output hardware-checksummed packets */
310 
311 	/* ECN stats */
312 	u_int32_t tcps_ecn_accepts;	/* ecn connections accepted */
313 	u_int32_t tcps_ecn_rcvece;	/* # of rcvd ece */
314 	u_int32_t tcps_ecn_rcvcwr;	/* # of rcvd cwr */
315 	u_int32_t tcps_ecn_rcvce;	/* # of rcvd ce in ip header */
316 	u_int32_t tcps_ecn_sndect;	/* # of cwr sent */
317 	u_int32_t tcps_ecn_sndece;	/* # of ece sent */
318 	u_int32_t tcps_ecn_sndcwr;	/* # of cwr sent */
319 	u_int32_t tcps_cwr_ecn;		/* # of cwnd reduced by ecn */
320 	u_int32_t tcps_cwr_frecovery;	/* # of cwnd reduced by fastrecovery */
321 	u_int32_t tcps_cwr_timeout;	/* # of cwnd reduced by timeout */
322 };
323 
324 /*
325  * Names for TCP sysctl objects.
326  */
327 
328 #define	TCPCTL_RFC1323		1 /* enable/disable RFC1323 timestamps/scaling */
329 #define	TCPCTL_KEEPINITTIME	2 /* TCPT_KEEP value */
330 #define TCPCTL_KEEPIDLE		3 /* allow tcp_keepidle to be changed */
331 #define TCPCTL_KEEPINTVL	4 /* allow tcp_keepintvl to be changed */
332 #define TCPCTL_SLOWHZ		5 /* return kernel idea of PR_SLOWHZ */
333 #define TCPCTL_BADDYNAMIC	6 /* return bad dynamic port bitmap */
334 #define	TCPCTL_RECVSPACE	7 /* receive buffer space */
335 #define	TCPCTL_SENDSPACE	8 /* send buffer space */
336 #define	TCPCTL_IDENT		9 /* get connection owner */
337 #define	TCPCTL_SACK	       10 /* selective acknowledgement, rfc 2018 */
338 #define TCPCTL_MSSDFLT	       11 /* Default maximum segment size */
339 #define	TCPCTL_RSTPPSLIMIT     12 /* RST pps limit */
340 #define	TCPCTL_ACK_ON_PUSH     13 /* ACK immediately on PUSH */
341 #define	TCPCTL_ECN	       14 /* RFC3168 ECN */
342 #define	TCPCTL_MAXID	       15
343 
344 #define	TCPCTL_NAMES { \
345 	{ 0, 0 }, \
346 	{ "rfc1323",	CTLTYPE_INT }, \
347 	{ "keepinittime",	CTLTYPE_INT }, \
348 	{ "keepidle",	CTLTYPE_INT }, \
349 	{ "keepintvl",	CTLTYPE_INT }, \
350 	{ "slowhz",	CTLTYPE_INT }, \
351 	{ "baddynamic", CTLTYPE_STRUCT }, \
352 	{ "recvspace",	CTLTYPE_INT }, \
353 	{ "sendspace",	CTLTYPE_INT }, \
354 	{ "ident", 	CTLTYPE_STRUCT }, \
355 	{ "sack",	CTLTYPE_INT }, \
356 	{ "mssdflt",	CTLTYPE_INT }, \
357 	{ "rstppslimit",	CTLTYPE_INT }, \
358 	{ "ackonpush",	CTLTYPE_INT }, \
359 	{ "ecn", 	CTLTYPE_INT }, \
360 }
361 
362 struct tcp_ident_mapping {
363 	struct sockaddr_storage faddr, laddr;
364 	int euid, ruid;
365 };
366 
367 #ifdef _KERNEL
368 extern	struct inpcbtable tcbtable;	/* head of queue of active tcpcb's */
369 extern	struct tcpstat tcpstat;	/* tcp statistics */
370 extern	u_int32_t tcp_now;		/* for RFC 1323 timestamps */
371 extern	int tcp_do_rfc1323;	/* enabled/disabled? */
372 extern	int tcp_mssdflt;	/* default maximum segment size */
373 extern	int tcp_ack_on_push;	/* ACK immediately on PUSH */
374 #ifdef TCP_SACK
375 extern	int tcp_do_sack;	/* SACK enabled/disabled */
376 extern	struct pool sackhl_pool;
377 #endif
378 extern	int tcp_do_ecn;		/* RFC3168 ECN enabled/disabled? */
379 
380 int	 tcp_attach(struct socket *);
381 void	 tcp_canceltimers(struct tcpcb *);
382 struct tcpcb *
383 	 tcp_close(struct tcpcb *);
384 #if defined(INET6) && !defined(TCP6)
385 void	 tcp6_ctlinput(int, struct sockaddr *, void *);
386 #endif
387 void	 *tcp_ctlinput(int, struct sockaddr *, void *);
388 int	 tcp_ctloutput(int, struct socket *, int, int, struct mbuf **);
389 struct tcpcb *
390 	 tcp_disconnect(struct tcpcb *);
391 struct tcpcb *
392 	 tcp_drop(struct tcpcb *, int);
393 void	 tcp_dooptions(struct tcpcb *, u_char *, int, struct tcphdr *,
394 		int *, u_int32_t *, u_int32_t *);
395 void	 tcp_drain(void);
396 void	 tcp_init(void);
397 #if defined(INET6) && !defined(TCP6)
398 int	 tcp6_input(struct mbuf **, int *, int);
399 #endif
400 void	 tcp_input(struct mbuf *, ...);
401 int	 tcp_mss(struct tcpcb *, int);
402 void	 tcp_mss_update(struct tcpcb *);
403 void	 tcp_mtudisc(struct inpcb *, int);
404 void	 tcp_mtudisc_increase(struct inpcb *, int);
405 #ifdef INET6
406 void	tcp6_mtudisc(struct inpcb *, int);
407 void	tcp6_mtudisc_callback(struct in6_addr *);
408 #endif
409 struct tcpcb *
410 	 tcp_newtcpcb(struct inpcb *);
411 void	 tcp_notify(struct inpcb *, int);
412 int	 tcp_output(struct tcpcb *);
413 void	 tcp_pulloutofband(struct socket *, u_int, struct mbuf *, int);
414 void	 tcp_quench(struct inpcb *, int);
415 int	 tcp_reass(struct tcpcb *, struct tcphdr *, struct mbuf *, int *);
416 void	 tcp_rscale(struct tcpcb *, u_long);
417 void	 tcp_respond(struct tcpcb *, caddr_t, struct mbuf *, tcp_seq,
418 		tcp_seq, int);
419 void	 tcp_setpersist(struct tcpcb *);
420 void	 tcp_slowtimo(void);
421 struct mbuf *
422 	 tcp_template(struct tcpcb *);
423 void	 tcp_trace(int, int, struct tcpcb *, caddr_t, int, int);
424 struct tcpcb *
425 	 tcp_usrclosed(struct tcpcb *);
426 int	 tcp_sysctl(int *, u_int, void *, size_t *, void *, size_t);
427 #if defined(INET6) && !defined(TCP6)
428 int	 tcp6_usrreq(struct socket *,
429 	    int, struct mbuf *, struct mbuf *, struct mbuf *, struct proc *);
430 #endif
431 int	 tcp_usrreq(struct socket *,
432 	    int, struct mbuf *, struct mbuf *, struct mbuf *);
433 void	 tcp_xmit_timer(struct tcpcb *, int);
434 void	 tcpdropoldhalfopen(struct tcpcb *, u_int16_t);
435 #ifdef TCP_SACK
436 int	 tcp_sack_option(struct tcpcb *,struct tcphdr *,u_char *,int);
437 void	 tcp_update_sack_list(struct tcpcb *tp);
438 void	 tcp_del_sackholes(struct tcpcb *, struct tcphdr *);
439 void	 tcp_clean_sackreport(struct tcpcb *tp);
440 void	 tcp_sack_adjust(struct tcpcb *tp);
441 struct sackhole *
442 	 tcp_sack_output(struct tcpcb *tp);
443 int	 tcp_sack_partialack(struct tcpcb *, struct tcphdr *);
444 #ifdef DEBUG
445 void	 tcp_print_holes(struct tcpcb *tp);
446 #endif
447 #endif /* TCP_SACK */
448 #if defined(TCP_SACK)
449 int	 tcp_newreno(struct tcpcb *, struct tcphdr *);
450 u_long	 tcp_seq_subtract(u_long, u_long );
451 #endif /* TCP_SACK */
452 #ifdef TCP_SIGNATURE
453 int	tcp_signature_apply(caddr_t, caddr_t, unsigned int);
454 #endif /* TCP_SIGNATURE */
455 void	tcp_rndiss_init(void);
456 tcp_seq	tcp_rndiss_next(void);
457 u_int16_t
458 	tcp_rndiss_encrypt(u_int16_t);
459 #endif /* _KERNEL */
460 #endif /* _NETINET_TCP_VAR_H_ */
461