2 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
30 #ifndef _SYSTEM_DOMAIN_H_
31 #define _SYSTEM_DOMAIN_H_
34 #include <sys/appleapiopts.h>
35 #include <sys/cdefs.h>
36 #include <sys/types.h>
39 #include <sys/queue.h>
40 #include <libkern/locks.h>
41 #include <sys/kern_control.h>
42 #endif /* KERNEL_PRIVATE */
44 /* Kernel Events Protocol */
45 #define SYSPROTO_EVENT 1 /* kernel events protocol */
47 /* Kernel Control Protocol */
48 #define SYSPROTO_CONTROL 2 /* kernel control protocol */
49 #define AF_SYS_CONTROL 2 /* corresponding sub address type */
51 /* System family socket address */
54 u_char ss_len
; /* sizeof(struct sockaddr_sys) */
55 u_char ss_family
; /* AF_SYSTEM */
56 u_int16_t ss_sysaddr
; /* protocol address in AF_SYSTEM */
57 u_int32_t ss_reserved
[7]; /* reserved to the protocol use */
64 * internal structure maintained for each register controller
71 TAILQ_ENTRY(kctl
) next
; /* controller chain */
73 /* controller information provided when registering */
74 char name
[MAX_KCTL_NAME
]; /* unique nke identifier, provided by DTS */
78 /* misc communication information */
79 u_int32_t flags
; /* support flags */
80 u_int32_t recvbufsize
; /* request more than the default buffer size */
81 u_int32_t sendbufsize
; /* request more than the default buffer size */
83 /* Dispatch functions */
84 ctl_connect_func connect
; /* Make contact */
85 ctl_disconnect_func disconnect
; /* Break contact */
86 ctl_send_func send
; /* Send data to nke */
87 ctl_setopt_func setopt
; /* set kctl configuration */
88 ctl_getopt_func getopt
; /* get kctl configuration */
90 TAILQ_HEAD(, ctl_cb
) kcb_head
;
95 TAILQ_ENTRY(ctl_cb
) next
; /* controller chain */
97 struct socket
*so
; /* controlling socket */
98 struct kctl
*kctl
; /* back pointer to controller */
105 extern struct domain systemdomain
;
107 /* built in system domain protocols init function */
109 int kern_event_init(void) __attribute__((section("__TEXT, initcode")));
110 int kern_control_init(void) __attribute__((section("__TEXT, initcode")));
113 #endif /* KERNEL_PRIVATE */
115 #endif /* _SYSTEM_DOMAIN_H_ */