diff options
Diffstat (limited to 'sys/netinet/tcp_var.h')
-rw-r--r-- | sys/netinet/tcp_var.h | 129 |
1 files changed, 83 insertions, 46 deletions
diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index e802220..8c175f8 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -35,14 +35,20 @@ #include <netinet/tcp.h> -struct vnet; +#ifdef _KERNEL +#include <net/vnet.h> /* * Kernel variables for tcp. */ -#ifdef VIMAGE_GLOBALS -extern int tcp_do_rfc1323; -#endif +VNET_DECLARE(int, tcp_do_rfc1323); +VNET_DECLARE(int, tcp_reass_qsize); +VNET_DECLARE(struct uma_zone *, tcp_reass_zone); +#define V_tcp_do_rfc1323 VNET_GET(tcp_do_rfc1323) +#define V_tcp_reass_qsize VNET_GET(tcp_reass_qsize) +#define V_tcp_reass_zone VNET_GET(tcp_reass_zone) + +#endif /* _KERNEL */ /* TCP segment queue entry */ struct tseg_qent { @@ -52,10 +58,6 @@ struct tseg_qent { struct mbuf *tqe_m; /* mbuf contains packet */ }; LIST_HEAD(tsegqe_head, tseg_qent); -#ifdef VIMAGE_GLOBALS -extern int tcp_reass_qsize; -#endif -extern struct uma_zone *tcp_reass_zone; struct sackblk { tcp_seq start; /* start seq no. of sack block */ @@ -538,44 +540,79 @@ MALLOC_DECLARE(M_TCPLOG); extern int tcp_log_in_vain; -#ifdef VIMAGE_GLOBALS -extern struct inpcbhead tcb; /* head of queue of active tcpcb's */ -extern struct inpcbinfo tcbinfo; -extern struct tcpstat tcpstat; /* tcp statistics */ -extern int tcp_mssdflt; /* XXX */ -extern int tcp_minmss; -extern int tcp_delack_enabled; -extern int tcp_do_newreno; -extern int path_mtu_discovery; -extern int ss_fltsz; -extern int ss_fltsz_local; - -extern int blackhole; -extern int drop_synfin; -extern int tcp_do_rfc3042; -extern int tcp_do_rfc3390; -extern int tcp_insecure_rst; -extern int tcp_do_autorcvbuf; -extern int tcp_autorcvbuf_inc; -extern int tcp_autorcvbuf_max; -extern int tcp_do_rfc3465; -extern int tcp_abc_l_var; - -extern int tcp_do_tso; -extern int tcp_do_autosndbuf; -extern int tcp_autosndbuf_inc; -extern int tcp_autosndbuf_max; - -extern int nolocaltimewait; - -extern int tcp_do_sack; /* SACK enabled/disabled */ -extern int tcp_sack_maxholes; -extern int tcp_sack_globalmaxholes; -extern int tcp_sack_globalholes; -extern int tcp_sc_rst_sock_fail; /* RST on sock alloc failure */ -extern int tcp_do_ecn; /* TCP ECN enabled/disabled */ -extern int tcp_ecn_maxretries; -#endif /* VIMAGE_GLOBALS */ +VNET_DECLARE(struct inpcbhead, tcb); /* queue of active tcpcb's */ +VNET_DECLARE(struct inpcbinfo, tcbinfo); +VNET_DECLARE(struct tcpstat, tcpstat); /* tcp statistics */ +VNET_DECLARE(int, tcp_mssdflt); /* XXX */ +VNET_DECLARE(int, tcp_minmss); +VNET_DECLARE(int, tcp_delack_enabled); +VNET_DECLARE(int, tcp_do_newreno); +VNET_DECLARE(int, path_mtu_discovery); +VNET_DECLARE(int, ss_fltsz); +VNET_DECLARE(int, ss_fltsz_local); + +#define V_tcb VNET_GET(tcb) +#define V_tcbinfo VNET_GET(tcbinfo) +#define V_tcpstat VNET_GET(tcpstat) +#define V_tcp_mssdflt VNET_GET(tcp_mssdflt) +#define V_tcp_minmss VNET_GET(tcp_minmss) +#define V_tcp_delack_enabled VNET_GET(tcp_delack_enabled) +#define V_tcp_do_newreno VNET_GET(tcp_do_newreno) +#define V_path_mtu_discovery VNET_GET(path_mtu_discovery) +#define V_ss_fltsz VNET_GET(ss_fltsz) +#define V_ss_fltsz_local VNET_GET(ss_fltsz_local) + +VNET_DECLARE(int, blackhole); +VNET_DECLARE(int, drop_synfin); +VNET_DECLARE(int, tcp_do_rfc3042); +VNET_DECLARE(int, tcp_do_rfc3390); +VNET_DECLARE(int, tcp_insecure_rst); +VNET_DECLARE(int, tcp_do_autorcvbuf); +VNET_DECLARE(int, tcp_autorcvbuf_inc); +VNET_DECLARE(int, tcp_autorcvbuf_max); +VNET_DECLARE(int, tcp_do_rfc3465); +VNET_DECLARE(int, tcp_abc_l_var); + +#define V_blackhole VNET_GET(blackhole) +#define V_drop_synfin VNET_GET(drop_synfin) +#define V_tcp_do_rfc3042 VNET_GET(tcp_do_rfc3042) +#define V_tcp_do_rfc3390 VNET_GET(tcp_do_rfc3390) +#define V_tcp_insecure_rst VNET_GET(tcp_insecure_rst) +#define V_tcp_do_autorcvbuf VNET_GET(tcp_do_autorcvbuf) +#define V_tcp_autorcvbuf_inc VNET_GET(tcp_autorcvbuf_inc) +#define V_tcp_autorcvbuf_max VNET_GET(tcp_autorcvbuf_max) +#define V_tcp_do_rfc3465 VNET_GET(tcp_do_rfc3465) +#define V_tcp_abc_l_var VNET_GET(tcp_abc_l_var) + +VNET_DECLARE(int, tcp_do_tso); +VNET_DECLARE(int, tcp_do_autosndbuf); +VNET_DECLARE(int, tcp_autosndbuf_inc); +VNET_DECLARE(int, tcp_autosndbuf_max); + +#define V_tcp_do_tso VNET_GET(tcp_do_tso) +#define V_tcp_do_autosndbuf VNET_GET(tcp_do_autosndbuf) +#define V_tcp_autosndbuf_inc VNET_GET(tcp_autosndbuf_inc) +#define V_tcp_autosndbuf_max VNET_GET(tcp_autosndbuf_max) + +VNET_DECLARE(int, nolocaltimewait); + +#define V_nolocaltimewait VNET_GET(nolocaltimewait) + +VNET_DECLARE(int, tcp_do_sack); /* SACK enabled/disabled */ +VNET_DECLARE(int, tcp_sack_maxholes); +VNET_DECLARE(int, tcp_sack_globalmaxholes); +VNET_DECLARE(int, tcp_sack_globalholes); +VNET_DECLARE(int, tcp_sc_rst_sock_fail); /* RST on sock alloc failure */ +VNET_DECLARE(int, tcp_do_ecn); /* TCP ECN enabled/disabled */ +VNET_DECLARE(int, tcp_ecn_maxretries); + +#define V_tcp_do_sack VNET_GET(tcp_do_sack) +#define V_tcp_sack_maxholes VNET_GET(tcp_sack_maxholes) +#define V_tcp_sack_globalmaxholes VNET_GET(tcp_sack_globalmaxholes) +#define V_tcp_sack_globalholes VNET_GET(tcp_sack_globalholes) +#define V_tcp_sc_rst_sock_fail VNET_GET(tcp_sc_rst_sock_fail) +#define V_tcp_do_ecn VNET_GET(tcp_do_ecn) +#define V_tcp_ecn_maxretries VNET_GET(tcp_ecn_maxretries) int tcp_addoptions(struct tcpopt *, u_char *); struct tcpcb * |