X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/1c79356b52d46aa6b508fb032f5ae709b1f2897b..593a1d5fd87cdf5b46dd5fcb84467b432cea0f91:/bsd/sys/domain.h diff --git a/bsd/sys/domain.h b/bsd/sys/domain.h index 1fbc76ed5..9d4fd75b5 100644 --- a/bsd/sys/domain.h +++ b/bsd/sys/domain.h @@ -1,23 +1,29 @@ /* - * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. * - * @APPLE_LICENSE_HEADER_START@ + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * - * The contents of this file constitute Original Code as defined in and - * are subject to the Apple Public Source License Version 1.1 (the - * "License"). You may not use this file except in compliance with the - * License. Please obtain a copy of the License at - * http://www.apple.com/publicsource and read it before using this file. + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. * - * This Original Code and all software distributed under the License are - * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the - * License for the specific language governing rights and limitations - * under the License. + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. * - * @APPLE_LICENSE_HEADER_END@ + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* Copyright (c) 1998, 1999 Apple Computer, Inc. All Rights Reserved */ /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ @@ -54,51 +60,70 @@ * SUCH DAMAGE. * * @(#)domain.h 8.1 (Berkeley) 6/2/93 + * $FreeBSD: src/sys/sys/domain.h,v 1.14 1999/12/29 04:24:40 peter Exp $ */ -#ifndef _SYS_DOMAIN_H_ +#ifndef _SYS_DOMAIN_H_ #define _SYS_DOMAIN_H_ +#ifdef PRIVATE + +#include +#ifdef KERNEL +#include +#endif /* KERNEL */ /* * Structure per communications domain. */ +#include + /* * Forward structure declarations for function prototypes [sic]. */ struct mbuf; +#define DOM_REENTRANT 0x01 + +#pragma pack(4) struct domain { int dom_family; /* AF_xxx */ - char *dom_name; - void (*dom_init) /* initialize domain data structures */ - __P((void)); - int (*dom_externalize) /* externalize access rights */ - __P((struct mbuf *)); - void (*dom_dispose) /* dispose of internalized rights */ - __P((struct mbuf *)); + const char *dom_name; + void (*dom_init)(void); /* initialize domain data structures */ + int (*dom_externalize)(struct mbuf *); + /* externalize access rights */ + void (*dom_dispose)(struct mbuf *); + /* dispose of internalized rights */ struct protosw *dom_protosw; /* Chain of protosw's for AF */ struct domain *dom_next; - int (*dom_rtattach) /* initialize routing table */ - __P((void **, int)); + int (*dom_rtattach)(void **, int); + /* initialize routing table */ int dom_rtoffset; /* an arg to rtattach, in bits */ int dom_maxrtkey; /* for routing layer */ int dom_protohdrlen; /* Let the protocol tell us */ int dom_refs; /* # socreates outstanding */ +#ifdef _KERN_LOCKS_H_ + lck_mtx_t *dom_mtx; /* domain global mutex */ +#else + void *dom_mtx; /* domain global mutex */ +#endif + u_long dom_flags; + u_long reserved[2]; }; +#pragma pack() + #ifdef KERNEL extern struct domain *domains; extern struct domain localdomain; + +__BEGIN_DECLS extern void net_add_domain(struct domain *dp); extern int net_del_domain(struct domain *); +__END_DECLS #define DOMAIN_SET(domain_set) -/* -#define DOMAIN_SET(name) \ - DATA_SET(domain_set, name ## domain) -*/ - -#endif +#endif /* KERNEL */ +#endif /* PRIVATE */ #endif /* _SYS_DOMAIN_H_ */