ADC Home > Reference Library > Reference > Darwin > Miscellaneous User Space API Reference
|
kern_control.h |
Includes: | <sys/appleapiopts.h> |
This header defines an API to communicate between a kernel extension and a process outside of the kernel.
ctl_event_data |
struct ctl_event_data { u_int32_t ctl_id; /* Kernel Controller ID */ u_int32_t ctl_unit; };
ctl_id
- The kernel control id.
ctl_unit
- The kernel control unit.
This structure is used for KEV_CTL_SUBCLASS kernel events.
ctl_info |
struct ctl_info { u_int32_t ctl_id; /* Kernel Controller ID */ char ctl_name[96 ]; /* Kernel Controller Name (a C string) */ };
ctl_id
- The kernel control id, filled out upon return.
ctl_name
- The kernel control name to find.
This structure is used with the CTLIOCGINFO ioctl to translate from a kernel control name to a control id.
sockaddr_ctl |
struct sockaddr_ctl { u_char sc_len; /* depends on size of bundle ID string */ u_char sc_family; /* AF_SYSTEM */ u_int16_t ss_sysaddr; /* AF_SYS_KERNCONTROL */ u_int32_t sc_id; /* Controller unique identifier */ u_int32_t sc_unit; /* Developer private unit number */ u_int32_t sc_reserved[5]; };
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.
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.
CTLIOCGCOUNT |
#define CTLIOCGCOUNT _IOR( 'N', 2, int) /* get number of control structures registered */
The CTLIOCGCOUNT ioctl can be used to determine the number of kernel controllers registered.
CTLIOCGINFO |
#define CTLIOCGINFO _IOWR( 'N', 3, struct ctl_info) /* get id from name */
The CTLIOCGINFO ioctl can be used to convert a kernel control name to a kernel control id.
KEV_CTL_DEREGISTERED |
#define KEV_CTL_DEREGISTERED 2 /* a controller disappears */
The event code indicating a controller was unregistered. The data portion will contain a ctl_event_data.
KEV_CTL_REGISTERED |
#define KEV_CTL_REGISTERED 1 /* a new controller appears */
The event code indicating a new controller was registered. The data portion will contain a ctl_event_data.
KEV_CTL_SUBCLASS |
#define KEV_CTL_SUBCLASS 2
The kernel event subclass for kernel control events.
MAX_KCTL_NAME |
#define MAX_KCTL_NAME 96
Kernel control names must be no longer than MAX_KCTL_NAME.