Deleted Added
full compact
tcp_var.h (121884) tcp_var.h (122922)
1/*
2 * Copyright (c) 1982, 1986, 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

--- 17 unchanged lines hidden (view full) ---

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)tcp_var.h 8.4 (Berkeley) 5/24/95
1/*
2 * Copyright (c) 1982, 1986, 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

--- 17 unchanged lines hidden (view full) ---

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)tcp_var.h 8.4 (Berkeley) 5/24/95
34 * $FreeBSD: head/sys/netinet/tcp_var.h 121884 2003-11-02 07:47:03Z silby $
34 * $FreeBSD: head/sys/netinet/tcp_var.h 122922 2003-11-20 20:07:39Z andre $
35 */
36
37#ifndef _NETINET_TCP_VAR_H_
38#define _NETINET_TCP_VAR_H_
39
40#include <netinet/in_pcb.h> /* needed for in_conninfo, inp_gen_t */
41#include <netinet/tcp.h>
42

--- 165 unchanged lines hidden (view full) ---

208 u_int8_t to_pad;
209};
210
211struct syncache {
212 inp_gen_t sc_inp_gencnt; /* pointer check */
213 struct tcpcb *sc_tp; /* tcb for listening socket */
214 struct mbuf *sc_ipopts; /* source route */
215 struct in_conninfo sc_inc; /* addresses */
35 */
36
37#ifndef _NETINET_TCP_VAR_H_
38#define _NETINET_TCP_VAR_H_
39
40#include <netinet/in_pcb.h> /* needed for in_conninfo, inp_gen_t */
41#include <netinet/tcp.h>
42

--- 165 unchanged lines hidden (view full) ---

208 u_int8_t to_pad;
209};
210
211struct syncache {
212 inp_gen_t sc_inp_gencnt; /* pointer check */
213 struct tcpcb *sc_tp; /* tcb for listening socket */
214 struct mbuf *sc_ipopts; /* source route */
215 struct in_conninfo sc_inc; /* addresses */
216#define sc_route sc_inc.inc_route
217#define sc_route6 sc_inc.inc6_route
218 u_int32_t sc_tsrecent;
219 tcp_cc sc_cc_send; /* holds CC or CCnew */
220 tcp_cc sc_cc_recv;
221 tcp_seq sc_irs; /* seq from peer */
222 tcp_seq sc_iss; /* our ISS */
223 u_long sc_rxttime; /* retransmit time */
224 u_int16_t sc_rxtslot; /* retransmit counter */
225 u_int16_t sc_peer_mss; /* peer's MSS */
226 u_int16_t sc_wnd; /* advertised window */
227 u_int8_t sc_requested_s_scale:4,
228 sc_request_r_scale:4;
229 u_int8_t sc_flags;
230#define SCF_NOOPT 0x01 /* no TCP options */
231#define SCF_WINSCALE 0x02 /* negotiated window scaling */
232#define SCF_TIMESTAMP 0x04 /* negotiated timestamps */
233#define SCF_CC 0x08 /* negotiated CC */
234#define SCF_UNREACH 0x10 /* icmp unreachable received */
216 u_int32_t sc_tsrecent;
217 tcp_cc sc_cc_send; /* holds CC or CCnew */
218 tcp_cc sc_cc_recv;
219 tcp_seq sc_irs; /* seq from peer */
220 tcp_seq sc_iss; /* our ISS */
221 u_long sc_rxttime; /* retransmit time */
222 u_int16_t sc_rxtslot; /* retransmit counter */
223 u_int16_t sc_peer_mss; /* peer's MSS */
224 u_int16_t sc_wnd; /* advertised window */
225 u_int8_t sc_requested_s_scale:4,
226 sc_request_r_scale:4;
227 u_int8_t sc_flags;
228#define SCF_NOOPT 0x01 /* no TCP options */
229#define SCF_WINSCALE 0x02 /* negotiated window scaling */
230#define SCF_TIMESTAMP 0x04 /* negotiated timestamps */
231#define SCF_CC 0x08 /* negotiated CC */
232#define SCF_UNREACH 0x10 /* icmp unreachable received */
235#define SCF_KEEPROUTE 0x20 /* keep cloned route */
236 TAILQ_ENTRY(syncache) sc_hash;
237 TAILQ_ENTRY(syncache) sc_timerq;
238};
239
240struct syncache_head {
241 TAILQ_HEAD(, syncache) sch_bucket;
242 u_int sch_length;
243};
244
233 TAILQ_ENTRY(syncache) sc_hash;
234 TAILQ_ENTRY(syncache) sc_timerq;
235};
236
237struct syncache_head {
238 TAILQ_HEAD(, syncache) sch_bucket;
239 u_int sch_length;
240};
241
242struct hc_metrics_lite { /* must stay in sync with hc_metrics */
243 u_long rmx_mtu; /* MTU for this path */
244 u_long rmx_ssthresh; /* outbound gateway buffer limit */
245 u_long rmx_rtt; /* estimated round trip time */
246 u_long rmx_rttvar; /* estimated rtt variance */
247 u_long rmx_bandwidth; /* estimated bandwidth */
248 u_long rmx_cwnd; /* congestion window */
249 u_long rmx_sendpipe; /* outbound delay-bandwidth product */
250 u_long rmx_recvpipe; /* inbound delay-bandwidth product */
251};
252
245struct tcptw {
246 struct inpcb *tw_inpcb; /* XXX back pointer to internet pcb */
247 tcp_seq snd_nxt;
248 tcp_seq rcv_nxt;
249 tcp_seq iss;
250 tcp_seq irs;
251 tcp_cc cc_recv;
252 tcp_cc cc_send;
253 u_short last_win; /* cached window value */
254 u_short tw_so_options; /* copy of so_options */
255 struct ucred *tw_cred; /* user credentials */
256 u_long t_recent;
257 u_long t_starttime;
258 int tw_time;
259 LIST_ENTRY(tcptw) tw_2msl;
260};
261
262/*
253struct tcptw {
254 struct inpcb *tw_inpcb; /* XXX back pointer to internet pcb */
255 tcp_seq snd_nxt;
256 tcp_seq rcv_nxt;
257 tcp_seq iss;
258 tcp_seq irs;
259 tcp_cc cc_recv;
260 tcp_cc cc_send;
261 u_short last_win; /* cached window value */
262 u_short tw_so_options; /* copy of so_options */
263 struct ucred *tw_cred; /* user credentials */
264 u_long t_recent;
265 u_long t_starttime;
266 int tw_time;
267 LIST_ENTRY(tcptw) tw_2msl;
268};
269
270/*
263 * The TAO cache entry which is stored in the protocol family specific
264 * portion of the route metrics.
271 * The TAO cache entry which is stored in the tcp hostcache.
265 */
266struct rmxp_tao {
267 tcp_cc tao_cc; /* latest CC in valid SYN */
268 tcp_cc tao_ccsent; /* latest CC sent to peer */
269 u_short tao_mssopt; /* peer's cached MSS */
270#ifdef notyet
271 u_short tao_flags; /* cache status flags */
272#define TAOF_DONT 0x0001 /* peer doesn't understand rfc1644 */
273#define TAOF_OK 0x0002 /* peer does understand rfc1644 */
274#define TAOF_UNDEF 0 /* we don't know yet */
275#endif /* notyet */
276};
272 */
273struct rmxp_tao {
274 tcp_cc tao_cc; /* latest CC in valid SYN */
275 tcp_cc tao_ccsent; /* latest CC sent to peer */
276 u_short tao_mssopt; /* peer's cached MSS */
277#ifdef notyet
278 u_short tao_flags; /* cache status flags */
279#define TAOF_DONT 0x0001 /* peer doesn't understand rfc1644 */
280#define TAOF_OK 0x0002 /* peer does understand rfc1644 */
281#define TAOF_UNDEF 0 /* we don't know yet */
282#endif /* notyet */
283};
277#define rmx_taop(r) ((struct rmxp_tao *)(r).rmx_filler)
278
279#define intotcpcb(ip) ((struct tcpcb *)(ip)->inp_ppcb)
280#define intotw(ip) ((struct tcptw *)(ip)->inp_ppcb)
281#define sototcpcb(so) (intotcpcb(sotoinpcb(so)))
282
283/*
284 * The smoothed round-trip time and estimated variance
285 * are stored as fixed point numbers scaled by the values below.

--- 110 unchanged lines hidden (view full) ---

396 u_long tcps_sc_reset; /* RST removed entry from syncache */
397 u_long tcps_sc_stale; /* timed out or listen socket gone */
398 u_long tcps_sc_aborted; /* syncache entry aborted */
399 u_long tcps_sc_badack; /* removed due to bad ACK */
400 u_long tcps_sc_unreach; /* ICMP unreachable received */
401 u_long tcps_sc_zonefail; /* zalloc() failed */
402 u_long tcps_sc_sendcookie; /* SYN cookie sent */
403 u_long tcps_sc_recvcookie; /* SYN cookie received */
284
285#define intotcpcb(ip) ((struct tcpcb *)(ip)->inp_ppcb)
286#define intotw(ip) ((struct tcptw *)(ip)->inp_ppcb)
287#define sototcpcb(so) (intotcpcb(sotoinpcb(so)))
288
289/*
290 * The smoothed round-trip time and estimated variance
291 * are stored as fixed point numbers scaled by the values below.

--- 110 unchanged lines hidden (view full) ---

402 u_long tcps_sc_reset; /* RST removed entry from syncache */
403 u_long tcps_sc_stale; /* timed out or listen socket gone */
404 u_long tcps_sc_aborted; /* syncache entry aborted */
405 u_long tcps_sc_badack; /* removed due to bad ACK */
406 u_long tcps_sc_unreach; /* ICMP unreachable received */
407 u_long tcps_sc_zonefail; /* zalloc() failed */
408 u_long tcps_sc_sendcookie; /* SYN cookie sent */
409 u_long tcps_sc_recvcookie; /* SYN cookie received */
410
411 u_long tcps_hc_added; /* entry added to hostcache */
412 u_long tcps_hc_bucketoverflow; /* hostcache per bucket limit hit */
404};
405
406/*
407 * TCB structure exported to user-land via sysctl(3).
408 * Evil hack: declare only if in_pcb.h and sys/socketvar.h have been
409 * included. Not all of our clients do.
410 */
411#if defined(_NETINET_IN_PCB_H_) && defined(_SYS_SOCKETVAR_H_)

--- 34 unchanged lines hidden (view full) ---

446 { "keepidle", CTLTYPE_INT }, \
447 { "keepintvl", CTLTYPE_INT }, \
448 { "sendspace", CTLTYPE_INT }, \
449 { "recvspace", CTLTYPE_INT }, \
450 { "keepinit", CTLTYPE_INT }, \
451 { "pcblist", CTLTYPE_STRUCT }, \
452 { "delacktime", CTLTYPE_INT }, \
453 { "v6mssdflt", CTLTYPE_INT }, \
413};
414
415/*
416 * TCB structure exported to user-land via sysctl(3).
417 * Evil hack: declare only if in_pcb.h and sys/socketvar.h have been
418 * included. Not all of our clients do.
419 */
420#if defined(_NETINET_IN_PCB_H_) && defined(_SYS_SOCKETVAR_H_)

--- 34 unchanged lines hidden (view full) ---

455 { "keepidle", CTLTYPE_INT }, \
456 { "keepintvl", CTLTYPE_INT }, \
457 { "sendspace", CTLTYPE_INT }, \
458 { "recvspace", CTLTYPE_INT }, \
459 { "keepinit", CTLTYPE_INT }, \
460 { "pcblist", CTLTYPE_STRUCT }, \
461 { "delacktime", CTLTYPE_INT }, \
462 { "v6mssdflt", CTLTYPE_INT }, \
463 { "maxid", CTLTYPE_INT }, \
454}
455
456
457#ifdef _KERNEL
458#ifdef SYSCTL_DECL
459SYSCTL_DECL(_net_inet_tcp);
460#endif
461

--- 15 unchanged lines hidden (view full) ---

477struct tcptw *
478 tcp_twclose(struct tcptw *_tw, int _reuse);
479void tcp_ctlinput(int, struct sockaddr *, void *);
480int tcp_ctloutput(struct socket *, struct sockopt *);
481struct tcpcb *
482 tcp_drop(struct tcpcb *, int);
483void tcp_drain(void);
484void tcp_fasttimo(void);
464}
465
466
467#ifdef _KERNEL
468#ifdef SYSCTL_DECL
469SYSCTL_DECL(_net_inet_tcp);
470#endif
471

--- 15 unchanged lines hidden (view full) ---

487struct tcptw *
488 tcp_twclose(struct tcptw *_tw, int _reuse);
489void tcp_ctlinput(int, struct sockaddr *, void *);
490int tcp_ctloutput(struct socket *, struct sockopt *);
491struct tcpcb *
492 tcp_drop(struct tcpcb *, int);
493void tcp_drain(void);
494void tcp_fasttimo(void);
485struct rmxp_tao *
486 tcp_gettaocache(struct in_conninfo *);
487void tcp_init(void);
488void tcp_input(struct mbuf *, int);
495void tcp_init(void);
496void tcp_input(struct mbuf *, int);
497u_long tcp_maxmtu(struct in_conninfo *);
498u_long tcp_maxmtu6(struct in_conninfo *);
489void tcp_mss(struct tcpcb *, int);
499void tcp_mss(struct tcpcb *, int);
490int tcp_mssopt(struct tcpcb *);
500int tcp_mssopt(struct in_conninfo *);
491struct inpcb *
492 tcp_drop_syn_sent(struct inpcb *, int);
493struct inpcb *
494 tcp_mtudisc(struct inpcb *, int);
495struct tcpcb *
496 tcp_newtcpcb(struct inpcb *);
497int tcp_output(struct tcpcb *);
498struct inpcb *
499 tcp_quench(struct inpcb *, int);
500void tcp_respond(struct tcpcb *, void *,
501 struct tcphdr *, struct mbuf *, tcp_seq, tcp_seq, int);
502int tcp_twrespond(struct tcptw *, struct socket *, struct mbuf *, int);
501struct inpcb *
502 tcp_drop_syn_sent(struct inpcb *, int);
503struct inpcb *
504 tcp_mtudisc(struct inpcb *, int);
505struct tcpcb *
506 tcp_newtcpcb(struct inpcb *);
507int tcp_output(struct tcpcb *);
508struct inpcb *
509 tcp_quench(struct inpcb *, int);
510void tcp_respond(struct tcpcb *, void *,
511 struct tcphdr *, struct mbuf *, tcp_seq, tcp_seq, int);
512int tcp_twrespond(struct tcptw *, struct socket *, struct mbuf *, int);
503struct rtentry *
504 tcp_rtlookup(struct in_conninfo *);
505void tcp_setpersist(struct tcpcb *);
506void tcp_slowtimo(void);
507struct tcptemp *
508 tcpip_maketemplate(struct inpcb *);
509void tcpip_fillheaders(struct inpcb *, void *, void *);
510struct tcpcb *
511 tcp_timers(struct tcpcb *, int);
512void tcp_trace(int, int, struct tcpcb *, void *, struct tcphdr *, int);
513void tcp_xmit_bandwidth_limit(struct tcpcb *tp, tcp_seq ack_seq);
514void syncache_init(void);
515void syncache_unreach(struct in_conninfo *, struct tcphdr *);
516int syncache_expand(struct in_conninfo *, struct tcphdr *,
517 struct socket **, struct mbuf *);
518int syncache_add(struct in_conninfo *, struct tcpopt *,
519 struct tcphdr *, struct socket **, struct mbuf *);
520void syncache_chkrst(struct in_conninfo *, struct tcphdr *);
521void syncache_badack(struct in_conninfo *);
513void tcp_setpersist(struct tcpcb *);
514void tcp_slowtimo(void);
515struct tcptemp *
516 tcpip_maketemplate(struct inpcb *);
517void tcpip_fillheaders(struct inpcb *, void *, void *);
518struct tcpcb *
519 tcp_timers(struct tcpcb *, int);
520void tcp_trace(int, int, struct tcpcb *, void *, struct tcphdr *, int);
521void tcp_xmit_bandwidth_limit(struct tcpcb *tp, tcp_seq ack_seq);
522void syncache_init(void);
523void syncache_unreach(struct in_conninfo *, struct tcphdr *);
524int syncache_expand(struct in_conninfo *, struct tcphdr *,
525 struct socket **, struct mbuf *);
526int syncache_add(struct in_conninfo *, struct tcpopt *,
527 struct tcphdr *, struct socket **, struct mbuf *);
528void syncache_chkrst(struct in_conninfo *, struct tcphdr *);
529void syncache_badack(struct in_conninfo *);
530/*
531 * All tcp_hc_* functions are IPv4 and IPv6 (via in_conninfo)
532 */
533void tcp_hc_init(void);
534void tcp_hc_get(struct in_conninfo *, struct hc_metrics_lite *);
535u_long tcp_hc_getmtu(struct in_conninfo *);
536void tcp_hc_gettao(struct in_conninfo *, struct rmxp_tao *);
537void tcp_hc_updatemtu(struct in_conninfo *, u_long);
538void tcp_hc_update(struct in_conninfo *, struct hc_metrics_lite *);
539void tcp_hc_updatetao(struct in_conninfo *, int, tcp_cc, u_short);
540/* update which tao field */
541#define TCP_HC_TAO_CC 0x1
542#define TCP_HC_TAO_CCSENT 0x2
543#define TCP_HC_TAO_MSSOPT 0x3
522
523extern struct pr_usrreqs tcp_usrreqs;
524extern u_long tcp_sendspace;
525extern u_long tcp_recvspace;
526tcp_seq tcp_new_isn(struct tcpcb *);
527
528#endif /* _KERNEL */
529
530#endif /* _NETINET_TCP_VAR_H_ */
544
545extern struct pr_usrreqs tcp_usrreqs;
546extern u_long tcp_sendspace;
547extern u_long tcp_recvspace;
548tcp_seq tcp_new_isn(struct tcpcb *);
549
550#endif /* _KERNEL */
551
552#endif /* _NETINET_TCP_VAR_H_ */