381a2a9a387f449fab7d0c7e97c4184c26963abfdr * CDDL HEADER START
381a2a9a387f449fab7d0c7e97c4184c26963abfdr * The contents of this file are subject to the terms of the
381a2a9a387f449fab7d0c7e97c4184c26963abfdr * Common Development and Distribution License (the "License").
381a2a9a387f449fab7d0c7e97c4184c26963abfdr * You may not use this file except in compliance with the License.
381a2a9a387f449fab7d0c7e97c4184c26963abfdr * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
381a2a9a387f449fab7d0c7e97c4184c26963abfdr * See the License for the specific language governing permissions
381a2a9a387f449fab7d0c7e97c4184c26963abfdr * and limitations under the License.
381a2a9a387f449fab7d0c7e97c4184c26963abfdr * When distributing Covered Code, include this CDDL HEADER in each
381a2a9a387f449fab7d0c7e97c4184c26963abfdr * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
381a2a9a387f449fab7d0c7e97c4184c26963abfdr * If applicable, add the following below this CDDL HEADER, with the
381a2a9a387f449fab7d0c7e97c4184c26963abfdr * fields enclosed by brackets "[]" replaced with your own identifying
381a2a9a387f449fab7d0c7e97c4184c26963abfdr * information: Portions Copyright [yyyy] [name of copyright owner]
381a2a9a387f449fab7d0c7e97c4184c26963abfdr * CDDL HEADER END
7ddc9b1afd18f260b9fb78ec7732facd91769131Darren Reed * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
381a2a9a387f449fab7d0c7e97c4184c26963abfdr * Use is subject to license terms.
381a2a9a387f449fab7d0c7e97c4184c26963abfdr * This file includes definitions of kernel hook framework components
381a2a9a387f449fab7d0c7e97c4184c26963abfdrextern "C" {
381a2a9a387f449fab7d0c7e97c4184c26963abfdr * Definition exposed to hook provider and consumer
7ddc9b1afd18f260b9fb78ec7732facd91769131Darren Reedtypedef int (* hook_func_t)(hook_event_token_t, hook_data_t, void *);
7ddc9b1afd18f260b9fb78ec7732facd91769131Darren Reed * A hook_notify_cmd_t is given as an argument to functions called as part of
7ddc9b1afd18f260b9fb78ec7732facd91769131Darren Reed * the notify callbacks that have been registered firing.
7ddc9b1afd18f260b9fb78ec7732facd91769131Darren Reed hook_hint_t h_hint; /* What type of hint is hintvalue */
7ddc9b1afd18f260b9fb78ec7732facd91769131Darren Reed void *h_arg; /* value to pass back into the hook */
381a2a9a387f449fab7d0c7e97c4184c26963abfdr (x)->h_name = (r); \
381a2a9a387f449fab7d0c7e97c4184c26963abfdr (x)->h_flags = 0; \
7ddc9b1afd18f260b9fb78ec7732facd91769131Darren Reed (x)->h_arg = (a); \
381a2a9a387f449fab7d0c7e97c4184c26963abfdr } while (0)
381a2a9a387f449fab7d0c7e97c4184c26963abfdr (x)->hf_name = (y); \
381a2a9a387f449fab7d0c7e97c4184c26963abfdr } while (0)
381a2a9a387f449fab7d0c7e97c4184c26963abfdr#define HOOK_RDONLY 0x1 /* Callbacks must not change data */
381a2a9a387f449fab7d0c7e97c4184c26963abfdr /* Multiple callbacks are allowed */
381a2a9a387f449fab7d0c7e97c4184c26963abfdr (x)->he_name = (y); \
381a2a9a387f449fab7d0c7e97c4184c26963abfdr (x)->he_flags = 0; \
381a2a9a387f449fab7d0c7e97c4184c26963abfdr } while (0)
7ddc9b1afd18f260b9fb78ec7732facd91769131Darren Reedtypedef int (* hook_notify_fn_t)(hook_notify_cmd_t, void *, const char *,
7ddc9b1afd18f260b9fb78ec7732facd91769131Darren Reed const char *, const char *);
381a2a9a387f449fab7d0c7e97c4184c26963abfdr#endif /* _SYS_HOOK_H */