2 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
24 #ifndef _SYSTEM_DOMAIN_H_
25 #define _SYSTEM_DOMAIN_H_
28 #include <sys/appleapiopts.h>
29 #include <sys/cdefs.h>
30 #include <sys/types.h>
33 #include <sys/queue.h>
34 #include <libkern/locks.h>
35 #include <sys/kern_control.h>
36 #endif /* KERNEL_PRIVATE */
38 /* Kernel Events Protocol */
39 #define SYSPROTO_EVENT 1 /* kernel events protocol */
41 /* Kernel Control Protocol */
42 #define SYSPROTO_CONTROL 2 /* kernel control protocol */
43 #define AF_SYS_CONTROL 2 /* corresponding sub address type */
45 /* System family socket address */
48 u_char ss_len
; /* sizeof(struct sockaddr_sys) */
49 u_char ss_family
; /* AF_SYSTEM */
50 u_int16_t ss_sysaddr
; /* protocol address in AF_SYSTEM */
51 u_int32_t ss_reserved
[7]; /* reserved to the protocol use */
58 * internal structure maintained for each register controller
65 TAILQ_ENTRY(kctl
) next
; /* controller chain */
67 /* controller information provided when registering */
68 char name
[MAX_KCTL_NAME
]; /* unique nke identifier, provided by DTS */
72 /* misc communication information */
73 u_int32_t flags
; /* support flags */
74 u_int32_t recvbufsize
; /* request more than the default buffer size */
75 u_int32_t sendbufsize
; /* request more than the default buffer size */
77 /* Dispatch functions */
78 ctl_connect_func connect
; /* Make contact */
79 ctl_disconnect_func disconnect
; /* Break contact */
80 ctl_send_func send
; /* Send data to nke */
81 ctl_setopt_func setopt
; /* set kctl configuration */
82 ctl_getopt_func getopt
; /* get kctl configuration */
84 TAILQ_HEAD(, ctl_cb
) kcb_head
;
89 TAILQ_ENTRY(ctl_cb
) next
; /* controller chain */
91 struct socket
*so
; /* controlling socket */
92 struct kctl
*kctl
; /* back pointer to controller */
98 extern struct domain systemdomain
;
100 /* built in system domain protocols init function */
102 int kern_event_init(void);
103 int kern_control_init(void);
106 #endif /* KERNEL_PRIVATE */
108 #endif /* _SYSTEM_DOMAIN_H_ */