diff options
author | lstewart <lstewart@FreeBSD.org> | 2010-12-28 12:13:30 +0000 |
---|---|---|
committer | lstewart <lstewart@FreeBSD.org> | 2010-12-28 12:13:30 +0000 |
commit | 446c1bbb1050c94f909d1e50d11fb077474dc734 (patch) | |
tree | 869629e383bc3e8573a40751fec17a42def4dc61 /sys/netinet/tcp_var.h | |
parent | 1f1cd9cdf4ed51b95c8b0990c8ebc10bb9973845 (diff) | |
download | FreeBSD-src-446c1bbb1050c94f909d1e50d11fb077474dc734.zip FreeBSD-src-446c1bbb1050c94f909d1e50d11fb077474dc734.tar.gz |
- Add some helper hook points to the TCP stack. The hooks allow Khelp modules to
access inbound/outbound events and associated data for established TCP
connections. The hooks only run if at least one hook function is registered
for the hook point, ensuring the impact on the stack is effectively nil when
no TCP Khelp modules are loaded. struct tcp_hhook_data is passed as contextual
data to any registered Khelp module hook functions.
- Add an OSD (Object Specific Data) pointer to struct tcpcb to allow Khelp
modules to associate per-connection data with the TCP control block.
- Bump __FreeBSD_version and add a note to UPDATING regarding to ABI changes
introduced by this commit and r216753.
In collaboration with: David Hayes <dahayes at swin edu au> and
Grenville Armitage <garmitage at swin edu au>
Sponsored by: FreeBSD Foundation
Reviewed by: bz, others along the way
MFC after: 3 months
Diffstat (limited to 'sys/netinet/tcp_var.h')
-rw-r--r-- | sys/netinet/tcp_var.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 3305b1a..4a43213 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -201,6 +201,7 @@ struct tcpcb { int t_bytes_acked; /* # bytes acked during current RTT */ struct cc_algo *cc_algo; /* congestion control algorithm */ struct cc_var *ccv; + struct osd *osd; /* storage for Khelp module data */ int t_ispare; /* explicit pad for 64bit alignment */ void *t_pspare2[4]; /* 4 TBD */ @@ -501,6 +502,22 @@ struct tcpstat { void kmod_tcpstat_inc(int statnum); #define KMOD_TCPSTAT_INC(name) \ kmod_tcpstat_inc(offsetof(struct tcpstat, name) / sizeof(u_long)) + +/* + * TCP specific helper hook point identifiers. + */ +#define HHOOK_TCP_EST_IN 0 +#define HHOOK_TCP_EST_OUT 1 +#define HHOOK_TCP_LAST HHOOK_TCP_EST_OUT + +struct tcp_hhook_data { + struct tcpcb *tp; + struct tcphdr *th; + struct tcpopt *to; + long len; + int tso; + tcp_seq curack; +}; #endif /* @@ -608,6 +625,9 @@ VNET_DECLARE(int, tcp_ecn_maxretries); #define V_tcp_do_ecn VNET(tcp_do_ecn) #define V_tcp_ecn_maxretries VNET(tcp_ecn_maxretries) +VNET_DECLARE(struct hhook_head *, tcp_hhh[HHOOK_TCP_LAST+1]); +#define V_tcp_hhh VNET(tcp_hhh) + int tcp_addoptions(struct tcpopt *, u_char *); int tcp_ccalgounload(struct cc_algo *unload_algo); struct tcpcb * |