uipc_domain.c (190909) | uipc_domain.c (193731) |
---|---|
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 --- 16 unchanged lines hidden (view full) --- 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 * @(#)uipc_domain.c 8.2 (Berkeley) 10/18/93 30 */ 31 32#include <sys/cdefs.h> | 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 --- 16 unchanged lines hidden (view full) --- 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 * @(#)uipc_domain.c 8.2 (Berkeley) 10/18/93 30 */ 31 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/sys/kern/uipc_domain.c 190909 2009-04-11 05:58:58Z zec $"); | 33__FBSDID("$FreeBSD: head/sys/kern/uipc_domain.c 193731 2009-06-08 17:15:40Z zec $"); |
34 35#include <sys/param.h> 36#include <sys/socket.h> 37#include <sys/protosw.h> 38#include <sys/domain.h> 39#include <sys/eventhandler.h> 40#include <sys/mbuf.h> 41#include <sys/kernel.h> --- 19 unchanged lines hidden (view full) --- 61static void domaininit(void *); 62SYSINIT(domain, SI_SUB_PROTO_DOMAIN, SI_ORDER_FIRST, domaininit, NULL); 63 64static void domainfinalize(void *); 65SYSINIT(domainfin, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_FIRST, domainfinalize, 66 NULL); 67 68static vnet_attach_fn net_init_domain; | 34 35#include <sys/param.h> 36#include <sys/socket.h> 37#include <sys/protosw.h> 38#include <sys/domain.h> 39#include <sys/eventhandler.h> 40#include <sys/mbuf.h> 41#include <sys/kernel.h> --- 19 unchanged lines hidden (view full) --- 61static void domaininit(void *); 62SYSINIT(domain, SI_SUB_PROTO_DOMAIN, SI_ORDER_FIRST, domaininit, NULL); 63 64static void domainfinalize(void *); 65SYSINIT(domainfin, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_FIRST, domainfinalize, 66 NULL); 67 68static vnet_attach_fn net_init_domain; |
69#ifdef VIMAGE 70static vnet_detach_fn net_detach_domain; 71#endif |
|
69 70static struct callout pffast_callout; 71static struct callout pfslow_callout; 72 73static void pffasttimo(void *); 74static void pfslowtimo(void *); 75 76struct domain *domains; /* registered protocol domains */ --- 25 unchanged lines hidden (view full) --- 102 .pru_soreceive = pru_soreceive_notsupp, 103 .pru_sopoll = pru_sopoll_notsupp, 104}; 105 106#ifndef VIMAGE_GLOBALS 107vnet_modinfo_t vnet_domain_modinfo = { 108 .vmi_id = VNET_MOD_DOMAIN, 109 .vmi_name = "domain", | 72 73static struct callout pffast_callout; 74static struct callout pfslow_callout; 75 76static void pffasttimo(void *); 77static void pfslowtimo(void *); 78 79struct domain *domains; /* registered protocol domains */ --- 25 unchanged lines hidden (view full) --- 105 .pru_soreceive = pru_soreceive_notsupp, 106 .pru_sopoll = pru_sopoll_notsupp, 107}; 108 109#ifndef VIMAGE_GLOBALS 110vnet_modinfo_t vnet_domain_modinfo = { 111 .vmi_id = VNET_MOD_DOMAIN, 112 .vmi_name = "domain", |
110 .vmi_iattach = net_init_domain | 113 .vmi_iattach = net_init_domain, 114#ifdef VIMAGE 115 .vmi_idetach = net_detach_domain, 116#endif |
111}; 112#endif 113 114static void 115protosw_init(struct protosw *pr) 116{ 117 struct pr_usrreqs *pu; 118 --- 66 unchanged lines hidden (view full) --- 185 */ 186 max_hdr = max_linkhdr + max_protohdr; 187 max_datalen = MHLEN - max_hdr; 188 if (max_datalen < 1) 189 panic("%s: max_datalen < 1", __func__); 190 return (0); 191} 192 | 117}; 118#endif 119 120static void 121protosw_init(struct protosw *pr) 122{ 123 struct pr_usrreqs *pu; 124 --- 66 unchanged lines hidden (view full) --- 191 */ 192 max_hdr = max_linkhdr + max_protohdr; 193 max_datalen = MHLEN - max_hdr; 194 if (max_datalen < 1) 195 panic("%s: max_datalen < 1", __func__); 196 return (0); 197} 198 |
199#ifdef VIMAGE |
|
193/* | 200/* |
201 * Detach / free a domain instance. 202 */ 203static int 204net_detach_domain(const void *arg) 205{ 206 const struct domain *dp = arg; 207 struct protosw *pr; 208 209 for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) 210 if (pr->pr_destroy) 211 (*pr->pr_destroy)(); 212 if (dp->dom_destroy) 213 (*dp->dom_destroy)(); 214 215 return (0); 216} 217#endif 218 219/* |
|
194 * Add a new protocol domain to the list of supported domains 195 * Note: you cant unload it again because a socket may be using it. 196 * XXX can't fail at this time. 197 */ 198void 199net_add_domain(void *data) 200{ 201 struct domain *dp; --- 316 unchanged lines hidden --- | 220 * Add a new protocol domain to the list of supported domains 221 * Note: you cant unload it again because a socket may be using it. 222 * XXX can't fail at this time. 223 */ 224void 225net_add_domain(void *data) 226{ 227 struct domain *dp; --- 316 unchanged lines hidden --- |