hook.h (381a2a9a) | hook.h (f4b3ec61) |
---|---|
1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 5 unchanged lines hidden (view full) --- 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21/* | 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 5 unchanged lines hidden (view full) --- 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21/* |
22 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. | 22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved. |
23 * Use is subject to license terms. 24 */ 25 26/* 27 * This file includes definitions of kernel hook framework components 28 */ 29 30#ifndef _SYS_HOOK_H 31#define _SYS_HOOK_H 32 33#pragma ident "%Z%%M% %I% %E% SMI" 34 35#include <sys/queue.h> | 23 * Use is subject to license terms. 24 */ 25 26/* 27 * This file includes definitions of kernel hook framework components 28 */ 29 30#ifndef _SYS_HOOK_H 31#define _SYS_HOOK_H 32 33#pragma ident "%Z%%M% %I% %E% SMI" 34 35#include <sys/queue.h> |
36#include <sys/netstack.h> |
|
36 37#ifdef __cplusplus 38extern "C" { 39#endif 40 41/* 42 * Definition exposed to hook provider and consumer 43 */ 44 45#define HOOK_VERSION 1 46 47typedef uintptr_t hook_data_t; 48 49struct hook_event_int; 50typedef struct hook_event_int *hook_event_token_t; 51 | 37 38#ifdef __cplusplus 39extern "C" { 40#endif 41 42/* 43 * Definition exposed to hook provider and consumer 44 */ 45 46#define HOOK_VERSION 1 47 48typedef uintptr_t hook_data_t; 49 50struct hook_event_int; 51typedef struct hook_event_int *hook_event_token_t; 52 |
52typedef int (* hook_func_t)(hook_event_token_t, hook_data_t); | 53typedef int (* hook_func_t)(hook_event_token_t, hook_data_t, netstack_t *); |
53 54/* 55 * Hook 56 */ 57typedef struct hook { 58 int32_t h_version; /* version number */ 59 hook_func_t h_func; /* callback func */ 60 char *h_name; /* name of this hook */ --- 41 unchanged lines hidden (view full) --- 102 do { \ 103 (x)->he_version = HOOK_VERSION; \ 104 (x)->he_name = (y); \ 105 (x)->he_flags = 0; \ 106 (x)->he_interested = B_FALSE; \ 107 _NOTE(CONSTCOND) \ 108 } while (0) 109 | 54 55/* 56 * Hook 57 */ 58typedef struct hook { 59 int32_t h_version; /* version number */ 60 hook_func_t h_func; /* callback func */ 61 char *h_name; /* name of this hook */ --- 41 unchanged lines hidden (view full) --- 103 do { \ 104 (x)->he_version = HOOK_VERSION; \ 105 (x)->he_name = (y); \ 106 (x)->he_flags = 0; \ 107 (x)->he_interested = B_FALSE; \ 108 _NOTE(CONSTCOND) \ 109 } while (0) 110 |
110 | |
111#ifdef __cplusplus 112} 113#endif 114 115#endif /* _SYS_HOOK_H */ | 111#ifdef __cplusplus 112} 113#endif 114 115#endif /* _SYS_HOOK_H */ |