tcp_var.h (292087) | tcp_var.h (292309) |
---|---|
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 --- 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_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 --- 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_var.h 8.4 (Berkeley) 5/24/95 |
30 * $FreeBSD: head/sys/netinet/tcp_var.h 292087 2015-12-11 06:22:58Z hiren $ | 30 * $FreeBSD: head/sys/netinet/tcp_var.h 292309 2015-12-16 00:56:45Z rrs $ |
31 */ 32 33#ifndef _NETINET_TCP_VAR_H_ 34#define _NETINET_TCP_VAR_H_ 35 36#include <netinet/tcp.h> 37 38#ifdef _KERNEL --- 45 unchanged lines hidden (view full) --- 84 85struct tcptemp { 86 u_char tt_ipgen[40]; /* the size must be of max ip header, now IPv6 */ 87 struct tcphdr tt_t; 88}; 89 90#define tcp6cb tcpcb /* for KAME src sync over BSD*'s */ 91 | 31 */ 32 33#ifndef _NETINET_TCP_VAR_H_ 34#define _NETINET_TCP_VAR_H_ 35 36#include <netinet/tcp.h> 37 38#ifdef _KERNEL --- 45 unchanged lines hidden (view full) --- 84 85struct tcptemp { 86 u_char tt_ipgen[40]; /* the size must be of max ip header, now IPv6 */ 87 struct tcphdr tt_t; 88}; 89 90#define tcp6cb tcpcb /* for KAME src sync over BSD*'s */ 91 |
92/* 93 * TODO: We yet need to brave plowing in 94 * to tcp_input() and the pru_usrreq() block. 95 * Right now these go to the old standards which 96 * are somewhat ok, but in the long term may 97 * need to be changed. If we do tackle tcp_input() 98 * then we need to get rid of the tcp_do_segment() 99 * function below. 100 */ 101/* Flags for tcp functions */ 102#define TCP_FUNC_BEING_REMOVED 0x01 /* Can no longer be referenced */ 103struct tcpcb; 104struct inpcb; 105struct sockopt; 106struct socket; 107 108struct tcp_function_block { 109 char tfb_tcp_block_name[TCP_FUNCTION_NAME_LEN_MAX]; 110 int (*tfb_tcp_output)(struct tcpcb *); 111 void (*tfb_tcp_do_segment)(struct mbuf *, struct tcphdr *, 112 struct socket *, struct tcpcb *, 113 int, int, uint8_t, 114 int); 115 int (*tfb_tcp_ctloutput)(struct socket *so, struct sockopt *sopt, 116 struct inpcb *inp, struct tcpcb *tp); 117 /* Optional memory allocation/free routine */ 118 void (*tfb_tcp_fb_init)(struct tcpcb *); 119 void (*tfb_tcp_fb_fini)(struct tcpcb *); 120 /* Optional timers, must define all if you define one */ 121 int (*tfb_tcp_timer_stop_all)(struct tcpcb *); 122 int (*tfb_tcp_timers_left)(struct tcpcb *); 123 void (*tfb_tcp_timer_activate)(struct tcpcb *, 124 uint32_t, u_int); 125 int (*tfb_tcp_timer_active)(struct tcpcb *, uint32_t); 126 void (*tfb_tcp_timer_stop)(struct tcpcb *, uint32_t); 127 volatile uint32_t tfb_refcnt; 128 uint32_t tfb_flags; 129}; 130 131struct tcp_function { 132 TAILQ_ENTRY(tcp_function) tf_next; 133 struct tcp_function_block *tf_fb; 134}; 135 136TAILQ_HEAD(tcp_funchead, tcp_function); 137 |
|
92/* 93 * Tcp control block, one per tcp; fields: 94 * Organized for 16 byte cacheline efficiency. 95 */ 96struct tcpcb { 97 struct tsegqe_head t_segq; /* segment reassembly queue */ 98 void *t_pspare[2]; /* new reassembly queue */ 99 int t_segqlen; /* segment reassembly queue length */ --- 102 unchanged lines hidden (view full) --- 202 u_int t_keepintvl; /* interval between keepalives */ 203 u_int t_keepcnt; /* number of keepalives before close */ 204 205 u_int t_tsomax; /* TSO total burst length limit in bytes */ 206 u_int t_tsomaxsegcount; /* TSO maximum segment count */ 207 u_int t_tsomaxsegsize; /* TSO maximum segment size in bytes */ 208 u_int t_pmtud_saved_maxopd; /* pre-blackhole MSS */ 209 u_int t_flags2; /* More tcpcb flags storage */ | 138/* 139 * Tcp control block, one per tcp; fields: 140 * Organized for 16 byte cacheline efficiency. 141 */ 142struct tcpcb { 143 struct tsegqe_head t_segq; /* segment reassembly queue */ 144 void *t_pspare[2]; /* new reassembly queue */ 145 int t_segqlen; /* segment reassembly queue length */ --- 102 unchanged lines hidden (view full) --- 248 u_int t_keepintvl; /* interval between keepalives */ 249 u_int t_keepcnt; /* number of keepalives before close */ 250 251 u_int t_tsomax; /* TSO total burst length limit in bytes */ 252 u_int t_tsomaxsegcount; /* TSO maximum segment count */ 253 u_int t_tsomaxsegsize; /* TSO maximum segment size in bytes */ 254 u_int t_pmtud_saved_maxopd; /* pre-blackhole MSS */ 255 u_int t_flags2; /* More tcpcb flags storage */ |
210 | |
211 uint32_t t_ispare[8]; /* 5 UTO, 3 TBD */ | 256 uint32_t t_ispare[8]; /* 5 UTO, 3 TBD */ |
212 void *t_pspare2[4]; /* 1 TCP_SIGNATURE, 3 TBD */ | 257 struct tcp_function_block *t_fb;/* TCP function call block */ 258 void *t_fb_ptr; /* Pointer to t_fb specific data */ 259 void *t_pspare2[2]; /* 1 TCP_SIGNATURE, 1 TBD */ |
213#if defined(_KERNEL) && defined(TCPPCAP) 214 struct mbufq t_inpkts; /* List of saved input packets. */ 215 struct mbufq t_outpkts; /* List of saved output packets. */ 216#ifdef _LP64 217 uint64_t _pad[0]; /* all used! */ 218#else 219 uint64_t _pad[2]; /* 2 are available */ 220#endif /* _LP64 */ --- 308 unchanged lines hidden (view full) --- 529 uint64_t tcps_sig_err_nosigopt; /* No signature provided by segment */ 530 531 uint64_t _pad[12]; /* 6 UTO, 6 TBD */ 532}; 533 534#define tcps_rcvmemdrop tcps_rcvreassfull /* compat */ 535 536#ifdef _KERNEL | 260#if defined(_KERNEL) && defined(TCPPCAP) 261 struct mbufq t_inpkts; /* List of saved input packets. */ 262 struct mbufq t_outpkts; /* List of saved output packets. */ 263#ifdef _LP64 264 uint64_t _pad[0]; /* all used! */ 265#else 266 uint64_t _pad[2]; /* 2 are available */ 267#endif /* _LP64 */ --- 308 unchanged lines hidden (view full) --- 576 uint64_t tcps_sig_err_nosigopt; /* No signature provided by segment */ 577 578 uint64_t _pad[12]; /* 6 UTO, 6 TBD */ 579}; 580 581#define tcps_rcvmemdrop tcps_rcvreassfull /* compat */ 582 583#ifdef _KERNEL |
584#define TI_UNLOCKED 1 585#define TI_RLOCKED 2 |
|
537#include <sys/counter.h> 538 539VNET_PCPUSTAT_DECLARE(struct tcpstat, tcpstat); /* tcp statistics */ 540/* 541 * In-kernel consumers can use these accessor macros directly to update 542 * stats. 543 */ 544#define TCPSTAT_ADD(name, val) \ --- 134 unchanged lines hidden (view full) --- 679void tcp_fini(void *); 680char *tcp_log_addrs(struct in_conninfo *, struct tcphdr *, void *, 681 const void *); 682char *tcp_log_vain(struct in_conninfo *, struct tcphdr *, void *, 683 const void *); 684int tcp_reass(struct tcpcb *, struct tcphdr *, int *, struct mbuf *); 685void tcp_reass_global_init(void); 686void tcp_reass_flush(struct tcpcb *); | 586#include <sys/counter.h> 587 588VNET_PCPUSTAT_DECLARE(struct tcpstat, tcpstat); /* tcp statistics */ 589/* 590 * In-kernel consumers can use these accessor macros directly to update 591 * stats. 592 */ 593#define TCPSTAT_ADD(name, val) \ --- 134 unchanged lines hidden (view full) --- 728void tcp_fini(void *); 729char *tcp_log_addrs(struct in_conninfo *, struct tcphdr *, void *, 730 const void *); 731char *tcp_log_vain(struct in_conninfo *, struct tcphdr *, void *, 732 const void *); 733int tcp_reass(struct tcpcb *, struct tcphdr *, int *, struct mbuf *); 734void tcp_reass_global_init(void); 735void tcp_reass_flush(struct tcpcb *); |
736void tcp_dooptions(struct tcpopt *, u_char *, int, int); 737void tcp_dropwithreset(struct mbuf *, struct tcphdr *, 738 struct tcpcb *, int, int); 739void tcp_pulloutofband(struct socket *, 740 struct tcphdr *, struct mbuf *, int); 741void tcp_xmit_timer(struct tcpcb *, int); 742void tcp_newreno_partial_ack(struct tcpcb *, struct tcphdr *); 743void cc_ack_received(struct tcpcb *tp, struct tcphdr *th, 744 uint16_t type); 745void cc_conn_init(struct tcpcb *tp); 746void cc_post_recovery(struct tcpcb *tp, struct tcphdr *th); 747void cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, uint32_t type); 748void hhook_run_tcp_est_in(struct tcpcb *tp, 749 struct tcphdr *th, struct tcpopt *to); 750 |
|
687int tcp_input(struct mbuf **, int *, int); | 751int tcp_input(struct mbuf **, int *, int); |
752void tcp_do_segment(struct mbuf *, struct tcphdr *, 753 struct socket *, struct tcpcb *, int, int, uint8_t, 754 int); 755 756int register_tcp_functions(struct tcp_function_block *blk, int wait); 757int deregister_tcp_functions(struct tcp_function_block *blk); 758struct tcp_function_block *find_and_ref_tcp_functions(struct tcp_function_set *fs); 759struct tcp_function_block *find_and_ref_tcp_fb(struct tcp_function_block *blk); 760int tcp_default_ctloutput(struct socket *so, struct sockopt *sopt, struct inpcb *inp, struct tcpcb *tp); 761 |
|
688u_long tcp_maxmtu(struct in_conninfo *, struct tcp_ifcap *); 689u_long tcp_maxmtu6(struct in_conninfo *, struct tcp_ifcap *); 690void tcp_mss_update(struct tcpcb *, int, int, struct hc_metrics_lite *, 691 struct tcp_ifcap *); 692void tcp_mss(struct tcpcb *, int); 693int tcp_mssopt(struct in_conninfo *); 694struct inpcb * 695 tcp_drop_syn_sent(struct inpcb *, int); --- 51 unchanged lines hidden (view full) --- 747void tcp_sack_adjust(struct tcpcb *tp); 748struct sackhole *tcp_sack_output(struct tcpcb *tp, int *sack_bytes_rexmt); 749void tcp_sack_partialack(struct tcpcb *, struct tcphdr *); 750void tcp_free_sackholes(struct tcpcb *tp); 751int tcp_newreno(struct tcpcb *, struct tcphdr *); 752u_long tcp_seq_subtract(u_long, u_long ); 753int tcp_compute_pipe(struct tcpcb *); 754 | 762u_long tcp_maxmtu(struct in_conninfo *, struct tcp_ifcap *); 763u_long tcp_maxmtu6(struct in_conninfo *, struct tcp_ifcap *); 764void tcp_mss_update(struct tcpcb *, int, int, struct hc_metrics_lite *, 765 struct tcp_ifcap *); 766void tcp_mss(struct tcpcb *, int); 767int tcp_mssopt(struct in_conninfo *); 768struct inpcb * 769 tcp_drop_syn_sent(struct inpcb *, int); --- 51 unchanged lines hidden (view full) --- 821void tcp_sack_adjust(struct tcpcb *tp); 822struct sackhole *tcp_sack_output(struct tcpcb *tp, int *sack_bytes_rexmt); 823void tcp_sack_partialack(struct tcpcb *, struct tcphdr *); 824void tcp_free_sackholes(struct tcpcb *tp); 825int tcp_newreno(struct tcpcb *, struct tcphdr *); 826u_long tcp_seq_subtract(u_long, u_long ); 827int tcp_compute_pipe(struct tcpcb *); 828 |
755void cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, uint32_t type); 756 | |
757static inline void 758tcp_fields_to_host(struct tcphdr *th) 759{ 760 761 th->th_seq = ntohl(th->th_seq); 762 th->th_ack = ntohl(th->th_ack); 763 th->th_win = ntohs(th->th_win); 764 th->th_urp = ntohs(th->th_urp); --- 16 unchanged lines hidden --- | 829static inline void 830tcp_fields_to_host(struct tcphdr *th) 831{ 832 833 th->th_seq = ntohl(th->th_seq); 834 th->th_ack = ntohl(th->th_ack); 835 th->th_win = ntohs(th->th_win); 836 th->th_urp = ntohs(th->th_urp); --- 16 unchanged lines hidden --- |