Date: Thu, 4 Feb 2010 03:19:32 +0000 (UTC) From: Lawrence Stewart <lstewart@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r203470 - in projects/tcp_cc_head/sys: conf netinet Message-ID: <201002040319.o143JWNV091360@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: lstewart Date: Thu Feb 4 03:19:32 2010 New Revision: 203470 URL: http://svn.freebsd.org/changeset/base/203470 Log: Helpers aren't and don't need to be TCP specific. Added: projects/tcp_cc_head/sys/netinet/helper.c - copied, changed from r203416, projects/tcp_cc_head/sys/netinet/tcp_helper.c projects/tcp_cc_head/sys/netinet/helper.h - copied unchanged from r203416, projects/tcp_cc_head/sys/netinet/tcp_helper.h projects/tcp_cc_head/sys/netinet/helper_module.h - copied unchanged from r203416, projects/tcp_cc_head/sys/netinet/tcp_helper_module.h Deleted: projects/tcp_cc_head/sys/netinet/tcp_helper.c projects/tcp_cc_head/sys/netinet/tcp_helper.h projects/tcp_cc_head/sys/netinet/tcp_helper_module.h Modified: projects/tcp_cc_head/sys/conf/files projects/tcp_cc_head/sys/netinet/ertt.c projects/tcp_cc_head/sys/netinet/tcp_subr.c Modified: projects/tcp_cc_head/sys/conf/files ============================================================================== --- projects/tcp_cc_head/sys/conf/files Thu Feb 4 03:07:48 2010 (r203469) +++ projects/tcp_cc_head/sys/conf/files Thu Feb 4 03:19:32 2010 (r203470) @@ -2435,6 +2435,7 @@ netgraph/ng_vlan.c optional netgraph_vl netinet/accf_data.c optional accept_filter_data inet netinet/accf_dns.c optional accept_filter_dns inet netinet/accf_http.c optional accept_filter_http inet +netinet/helper.c optional inet netinet/if_atm.c optional atm netinet/if_ether.c optional inet ether netinet/igmp.c optional inet @@ -2485,7 +2486,6 @@ netinet/sctp_timer.c optional inet sctp netinet/sctp_usrreq.c optional inet sctp netinet/sctputil.c optional inet sctp netinet/tcp_debug.c optional tcpdebug -netinet/tcp_helper.c optional inet netinet/tcp_hostcache.c optional inet netinet/tcp_input.c optional inet netinet/tcp_lro.c optional inet Modified: projects/tcp_cc_head/sys/netinet/ertt.c ============================================================================== --- projects/tcp_cc_head/sys/netinet/ertt.c Thu Feb 4 03:07:48 2010 (r203469) +++ projects/tcp_cc_head/sys/netinet/ertt.c Thu Feb 4 03:19:32 2010 (r203470) @@ -44,12 +44,12 @@ __FBSDID("$FreeBSD$"); #include <net/if.h> #include <net/pfil.h> +#include <netinet/helper.h> +#include <netinet/helper_module.h> #include <netinet/in.h> #include <netinet/in_pcb.h> #include <netinet/in_var.h> #include <netinet/tcp_var.h> -#include <netinet/tcp_helper.h> -#include <netinet/tcp_helper_module.h> struct ertt { int test; Copied and modified: projects/tcp_cc_head/sys/netinet/helper.c (from r203416, projects/tcp_cc_head/sys/netinet/tcp_helper.c) ============================================================================== --- projects/tcp_cc_head/sys/netinet/tcp_helper.c Wed Feb 3 04:58:08 2010 (r203416, copy source) +++ projects/tcp_cc_head/sys/netinet/helper.c Thu Feb 4 03:19:32 2010 (r203470) @@ -38,8 +38,8 @@ __FBSDID("$FreeBSD$"); #include <sys/queue.h> #include <sys/systm.h> -#include <netinet/tcp_helper.h> -#include <netinet/tcp_helper_module.h> +#include <netinet/helper.h> +#include <netinet/helper_module.h> struct hlpr_head helpers = STAILQ_HEAD_INITIALIZER(helpers); Copied: projects/tcp_cc_head/sys/netinet/helper.h (from r203416, projects/tcp_cc_head/sys/netinet/tcp_helper.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/tcp_cc_head/sys/netinet/helper.h Thu Feb 4 03:19:32 2010 (r203470, copy of r203416, projects/tcp_cc_head/sys/netinet/tcp_helper.h) @@ -0,0 +1,68 @@ +/*- + * Copyright (c) 2010 Lawrence Stewart <lstewart@freebsd.org> + * All rights reserved. + * + * This software was developed at the Centre for Advanced Internet + * Architectures, Swinburne University, by Lawrence Stewart, + * made possible in part by a grant from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _TCP_HELPER_H +#define _TCP_HELPER_H + + +struct helper { + /* Init global module state on kldload. */ + int (*mod_init) (void); + + /* Cleanup global module state on kldunload. */ + int (*mod_destroy) (void); + + int (*block_init) (uintptr_t *data); + int (*block_destroy) (uintptr_t *data); + + uint16_t flags; + + //STAILQ hooks; /* which hooks does this helper want to be called from */ + //STAILQ struct helper_data; + int dynamic_id; /* ID assigned by system to this hlpr's data in the + dynamic array */ + + + STAILQ_ENTRY(helper) entries; +}; + +/* Helper flags */ +#define HLPR_NEEDS_DATABLOCK 0x0001 + +extern STAILQ_HEAD(hlpr_head, helper) helpers; + +int init_datablocks(uintptr_t **array_head, int *nblocks); +int destroy_datablocks(uintptr_t **array_head, int nblocks); +int register_helper(struct helper *h); +int deregister_helper(struct helper *h); + +#endif /* _TCP_HELPER_H */ Copied: projects/tcp_cc_head/sys/netinet/helper_module.h (from r203416, projects/tcp_cc_head/sys/netinet/tcp_helper_module.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/tcp_cc_head/sys/netinet/helper_module.h Thu Feb 4 03:19:32 2010 (r203470, copy of r203416, projects/tcp_cc_head/sys/netinet/tcp_helper_module.h) @@ -0,0 +1,51 @@ +/*- + * Copyright (c) 2010 Lawrence Stewart <lstewart@freebsd.org> + * All rights reserved. + * + * This software was developed at the Centre for Advanced Internet + * Architectures, Swinburne University, by Lawrence Stewart, + * made possible in part by a grant from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _NETINET_TCP_HELPER_MODULE_H_ +#define _NETINET_TCP_HELPER_MODULE_H_ + +#define DECLARE_HELPER(hlprname, hlpr_data) \ + static moduledata_t hlpr_##hlprname = { \ + #hlprname, \ + hlpr_modevent, \ + hlpr_data \ + }; \ + DECLARE_MODULE(hlprname, hlpr_##hlprname, SI_SUB_PROTO_IFATTACHDOMAIN, \ + SI_ORDER_ANY) + +int hlpr_modevent(module_t mod, int type, void *data); + +MALLOC_DECLARE(M_HLPR); +MALLOC_DEFINE(M_HLPR, "helper data", "Blah"); + + +#endif Modified: projects/tcp_cc_head/sys/netinet/tcp_subr.c ============================================================================== --- projects/tcp_cc_head/sys/netinet/tcp_subr.c Thu Feb 4 03:07:48 2010 (r203469) +++ projects/tcp_cc_head/sys/netinet/tcp_subr.c Thu Feb 4 03:19:32 2010 (r203470) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include <net/vnet.h> #include <netinet/cc.h> +#include <netinet/helper.h> #include <netinet/in.h> #include <netinet/in_systm.h> #include <netinet/ip.h> @@ -85,7 +86,6 @@ __FBSDID("$FreeBSD$"); #endif #include <netinet/ip_icmp.h> #include <netinet/tcp_fsm.h> -#include <netinet/tcp_helper.h> #include <netinet/tcp_seq.h> #include <netinet/tcp_timer.h> #include <netinet/tcp_var.h>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201002040319.o143JWNV091360>