Introduction
This header defines an API to communicate between a kernel
extension and a process outside of the kernel.
Structs and Unions
struct ctl_event_data {
u_int32_t ctl_id;
u_int32_t ctl_unit;
};
Fields
ctl_id
- The kernel control id.
ctl_unit
- The kernel control unit.
Discussion
This structure is used for KEV_CTL_SUBCLASS kernel
events.
struct ctl_info {
u_int32_t ctl_id;
char ctl_name[96 ];
};
Fields
ctl_id
- The kernel control id, filled out upon return.
ctl_name
- The kernel control name to find.
Discussion
This structure is used with the CTLIOCGINFO ioctl to
translate from a kernel control name to a control id.
struct sockaddr_ctl {
u_char sc_len;
u_char sc_family;
u_int16_t ss_sysaddr;
u_int32_t sc_id;
u_int32_t sc_unit;
u_int32_t sc_reserved[5];
};
Fields
sc_len
- The length of the structure.
sc_family
- AF_SYSTEM.
ss_sysaddr
- AF_SYS_KERNCONTROL.
sc_id
- Controller unique identifier.
sc_unit
- Kernel controller private unit number.
sc_reserved
- Reserved, must be set to zero.
Discussion
The controller address structure is used to establish
contact between a user client and a kernel controller. The
sc_id/sc_unit uniquely identify each controller. sc_id is a
unique identifier assigned to the controller. The identifier can
be assigned by the system at registration time or be a 32-bit
creator code obtained from Apple Computer. sc_unit is a unit
number for this sc_id, and is privately used by the kernel
controller to identify several instances of the controller.
#defines
#define CTLIOCGCOUNT _IOR(
'N', 2, int)
Discussion
The CTLIOCGCOUNT ioctl can be used to determine the
number of kernel controllers registered.
#define CTLIOCGINFO _IOWR(
'N', 3, struct ctl_info)
Discussion
The CTLIOCGINFO ioctl can be used to convert a kernel
control name to a kernel control id.
#define KEV_CTL_DEREGISTERED 2
Discussion
The event code indicating a controller was unregistered.
The data portion will contain a ctl_event_data.
#define KEV_CTL_REGISTERED 1
Discussion
The event code indicating a new controller was
registered. The data portion will contain a ctl_event_data.
#define KEV_CTL_SUBCLASS 2
Discussion
The kernel event subclass for kernel control events.
#define MAX_KCTL_NAME 96
Discussion
Kernel control names must be no longer than
MAX_KCTL_NAME.
|
Did this document help you? |
Yes: Tell us what works for you.
|
|
Last Updated: 2006-06-20