2 * Copyright (c) 2000 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@
22 /* Copyright (c) 1998, 1999 Apple Computer, Inc. All Rights Reserved */
25 #ifndef SYS_KERN_EVENT_H
26 #define SYS_KERN_EVENT_H
28 #include <sys/appleapiopts.h>
29 #include <sys/ioccom.h>
30 #include <sys/sys_domain.h>
33 #define KEV_SNDSPACE (4 * 1024)
34 #define KEV_RECVSPACE (8 * 1024)
36 #define KEV_ANY_VENDOR 0
37 #define KEV_ANY_CLASS 0
38 #define KEV_ANY_SUBCLASS 0
44 #define KEV_VENDOR_APPLE 1
48 * Definition of top-level classifications
51 #define KEV_NETWORK_CLASS 1
52 #define KEV_IOKIT_CLASS 2
53 #define KEV_SYSTEM_CLASS 3
56 struct kern_event_msg
{
57 u_long total_size
; /* Size of entire event msg */
58 u_long vendor_code
; /* For non-Apple extensibility */
59 u_long kev_class
; /* Layer of event source */
60 u_long kev_subclass
; /* Component within layer */
61 u_long id
; /* Monotonically increasing value */
62 u_long event_code
; /* unique code */
63 u_long event_data
[1]; /* One or more data longwords */
67 #define KEV_MSG_HEADER_SIZE (6 * sizeof(u_long))
76 #define SIOCGKEVID _IOR('e', 1, u_long)
77 #define SIOCSKEVFILT _IOW('e', 2, struct kev_request)
78 #define SIOCGKEVFILT _IOR('e', 3, struct kev_request)
81 #ifdef __APPLE_API_UNSTABLE
83 #define N_KEV_VECTORS 5
85 struct kev_d_vectors
{
87 u_long data_length
; /* Length of the event data */
88 void *data_ptr
; /* Pointer to event data */
93 u_long vendor_code
; /* For non-Apple extensibility */
94 u_long kev_class
; /* Layer of event source */
95 u_long kev_subclass
; /* Component within layer */
96 u_long event_code
; /* The event code */
97 struct kev_d_vectors dv
[N_KEV_VECTORS
]; /* Up to n data vectors */
100 int kev_post_msg(struct kev_msg
*event
);
102 #endif /* ___APPLE_API_UNSTABLE */
103 #ifdef __APPLE_API_PRIVATE
105 LIST_HEAD(kern_event_head
, kern_event_pcb
);
107 struct kern_event_pcb
{
108 LIST_ENTRY(kern_event_pcb
) ev_link
; /* glue on list of all PCBs */
109 struct socket
*ev_socket
; /* pointer back to socket */
110 u_long vendor_code_filter
;
112 u_long subclass_filter
;
115 #define sotoevpcb(so) ((struct kern_event_pcb *)((so)->so_pcb))
117 #endif /* __APPLE_API_PRIVATE */