uipc_domain.c (50477) | uipc_domain.c (69286) |
---|---|
1/* 2 * Copyright (c) 1982, 1986, 1993 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 * @(#)uipc_domain.c 8.2 (Berkeley) 10/18/93 | 1/* 2 * Copyright (c) 1982, 1986, 1993 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 * @(#)uipc_domain.c 8.2 (Berkeley) 10/18/93 |
34 * $FreeBSD: head/sys/kern/uipc_domain.c 50477 1999-08-28 01:08:13Z peter $ | 34 * $FreeBSD: head/sys/kern/uipc_domain.c 69286 2000-11-27 22:52:31Z jake $ |
35 */ 36 37#include <sys/param.h> 38#include <sys/socket.h> 39#include <sys/protosw.h> 40#include <sys/domain.h> 41#include <sys/mbuf.h> 42#include <sys/kernel.h> --- 13 unchanged lines hidden (view full) --- 56 * 57 * Where 'xxx' is replaced by the address of a parameter struct to be 58 * passed to the doamin_add() function. 59 */ 60 61static void domaininit __P((void *)); 62SYSINIT(domain, SI_SUB_PROTO_DOMAIN, SI_ORDER_FIRST, domaininit, NULL) 63 | 35 */ 36 37#include <sys/param.h> 38#include <sys/socket.h> 39#include <sys/protosw.h> 40#include <sys/domain.h> 41#include <sys/mbuf.h> 42#include <sys/kernel.h> --- 13 unchanged lines hidden (view full) --- 56 * 57 * Where 'xxx' is replaced by the address of a parameter struct to be 58 * passed to the doamin_add() function. 59 */ 60 61static void domaininit __P((void *)); 62SYSINIT(domain, SI_SUB_PROTO_DOMAIN, SI_ORDER_FIRST, domaininit, NULL) 63 |
64static struct callout pffast_callout; 65static struct callout pfslow_callout; 66 |
|
64static void pffasttimo __P((void *)); 65static void pfslowtimo __P((void *)); 66 67struct domain *domains; 68 69/* 70 * Add a new protocol domain to the list of supported domains 71 * Note: you cant unload it again because a socket may be using it. --- 60 unchanged lines hidden (view full) --- 132 * use in sonewconn(). 133 */ 134 socket_zone = zinit("socket", sizeof(struct socket), maxsockets, 135 ZONE_INTERRUPT, 0); 136 137 if (max_linkhdr < 16) /* XXX */ 138 max_linkhdr = 16; 139 | 67static void pffasttimo __P((void *)); 68static void pfslowtimo __P((void *)); 69 70struct domain *domains; 71 72/* 73 * Add a new protocol domain to the list of supported domains 74 * Note: you cant unload it again because a socket may be using it. --- 60 unchanged lines hidden (view full) --- 135 * use in sonewconn(). 136 */ 137 socket_zone = zinit("socket", sizeof(struct socket), maxsockets, 138 ZONE_INTERRUPT, 0); 139 140 if (max_linkhdr < 16) /* XXX */ 141 max_linkhdr = 16; 142 |
140 timeout(pffasttimo, (void *)0, 1); 141 timeout(pfslowtimo, (void *)0, 1); | 143 callout_init(&pffast_callout, 0); 144 callout_init(&pfslow_callout, 0); 145 146 callout_reset(&pffast_callout, 1, pffasttimo, NULL); 147 callout_reset(&pfslow_callout, 1, pfslowtimo, NULL); |
142} 143 144 145struct protosw * 146pffindtype(family, type) 147 int family; 148 int type; 149{ --- 59 unchanged lines hidden (view full) --- 209{ 210 register struct domain *dp; 211 register struct protosw *pr; 212 213 for (dp = domains; dp; dp = dp->dom_next) 214 for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) 215 if (pr->pr_slowtimo) 216 (*pr->pr_slowtimo)(); | 148} 149 150 151struct protosw * 152pffindtype(family, type) 153 int family; 154 int type; 155{ --- 59 unchanged lines hidden (view full) --- 215{ 216 register struct domain *dp; 217 register struct protosw *pr; 218 219 for (dp = domains; dp; dp = dp->dom_next) 220 for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) 221 if (pr->pr_slowtimo) 222 (*pr->pr_slowtimo)(); |
217 timeout(pfslowtimo, (void *)0, hz/2); | 223 callout_reset(&pfslow_callout, hz/2, pfslowtimo, NULL); |
218} 219 220static void 221pffasttimo(arg) 222 void *arg; 223{ 224 register struct domain *dp; 225 register struct protosw *pr; 226 227 for (dp = domains; dp; dp = dp->dom_next) 228 for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) 229 if (pr->pr_fasttimo) 230 (*pr->pr_fasttimo)(); | 224} 225 226static void 227pffasttimo(arg) 228 void *arg; 229{ 230 register struct domain *dp; 231 register struct protosw *pr; 232 233 for (dp = domains; dp; dp = dp->dom_next) 234 for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) 235 if (pr->pr_fasttimo) 236 (*pr->pr_fasttimo)(); |
231 timeout(pffasttimo, (void *)0, hz/5); | 237 callout_reset(&pffast_callout, hz/5, pffasttimo, NULL); |
232} | 238} |