2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
25 /* Copyright (c) 1998, 1999 Apple Computer, Inc. All Rights Reserved */
28 #ifndef SYS_KERN_EVENT_H
29 #define SYS_KERN_EVENT_H
31 #include <sys/appleapiopts.h>
32 #include <sys/ioccom.h>
33 #include <sys/sys_domain.h>
36 #define KEV_SNDSPACE (4 * 1024)
37 #define KEV_RECVSPACE (8 * 1024)
39 #define KEV_ANY_VENDOR 0
40 #define KEV_ANY_CLASS 0
41 #define KEV_ANY_SUBCLASS 0
47 #define KEV_VENDOR_APPLE 1
51 * Definition of top-level classifications
54 #define KEV_NETWORK_CLASS 1
55 #define KEV_IOKIT_CLASS 2
56 #define KEV_SYSTEM_CLASS 3
59 struct kern_event_msg
{
60 u_long total_size
; /* Size of entire event msg */
61 u_long vendor_code
; /* For non-Apple extensibility */
62 u_long kev_class
; /* Layer of event source */
63 u_long kev_subclass
; /* Component within layer */
64 u_long id
; /* Monotonically increasing value */
65 u_long event_code
; /* unique code */
66 u_long event_data
[1]; /* One or more data longwords */
70 #define KEV_MSG_HEADER_SIZE (6 * sizeof(u_long))
79 #define SIOCGKEVID _IOR('e', 1, u_long)
80 #define SIOCSKEVFILT _IOW('e', 2, struct kev_request)
81 #define SIOCGKEVFILT _IOR('e', 3, struct kev_request)
84 #ifdef __APPLE_API_UNSTABLE
86 #define N_KEV_VECTORS 5
88 struct kev_d_vectors
{
90 u_long data_length
; /* Length of the event data */
91 void *data_ptr
; /* Pointer to event data */
96 u_long vendor_code
; /* For non-Apple extensibility */
97 u_long kev_class
; /* Layer of event source */
98 u_long kev_subclass
; /* Component within layer */
99 u_long event_code
; /* The event code */
100 struct kev_d_vectors dv
[N_KEV_VECTORS
]; /* Up to n data vectors */
103 int kev_post_msg(struct kev_msg
*event
);
105 #endif /* ___APPLE_API_UNSTABLE */
106 #ifdef __APPLE_API_PRIVATE
108 LIST_HEAD(kern_event_head
, kern_event_pcb
);
110 struct kern_event_pcb
{
111 LIST_ENTRY(kern_event_pcb
) ev_link
; /* glue on list of all PCBs */
112 struct socket
*ev_socket
; /* pointer back to socket */
113 u_long vendor_code_filter
;
115 u_long subclass_filter
;
118 #define sotoevpcb(so) ((struct kern_event_pcb *)((so)->so_pcb))
120 #endif /* __APPLE_API_PRIVATE */