2 * ckrm_ce.h - Header file to be used by Classification Engine of CKRM
4 * Copyright (C) Hubertus Franke, IBM Corp. 2003
5 * (C) Shailabh Nagar, IBM Corp. 2003
6 * (C) Chandra Seetharaman, IBM Corp. 2003
8 * Provides data structures, macros and kernel API of CKRM for
9 * classification engine.
11 * Latest version, more details at http://ckrm.sf.net
13 * This program is free software; you can redistribute it and/or modify it
14 * under the terms of version 2.1 of the GNU Lesser General Public License
15 * as published by the Free Software Foundation.
17 * This program is distributed in the hope that it would be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
28 * Adopted to classtypes
31 #ifndef _LINUX_CKRM_CE_H
32 #define _LINUX_CKRM_CE_H
36 #include <linux/ckrm_events.h>
39 * Action parameters identifying the cause of a task<->class notify callback
40 * these can perculate up to user daemon consuming records send by the
41 * classification engine
46 typedef void *(*ce_classify_fct_t) (enum ckrm_event event, void *obj, ...);
47 typedef void (*ce_notify_fct_t) (enum ckrm_event event, void *classobj,
50 typedef struct ckrm_eng_callback {
51 /* general state information */
52 int always_callback; /* set if CE should always be called back
53 regardless of numclasses */
55 /* callbacks which are called without holding locks */
57 unsigned long c_interest; /* set of classification events of
61 /* generic classify */
62 ce_classify_fct_t classify;
65 void (*class_add) (const char *name, void *core, int classtype);
68 void (*class_delete) (const char *name, void *core, int classtype);
70 /* callbacks which are called while holding task_lock(tsk) */
71 unsigned long n_interest; /* set of notification events of
74 /* notify on class switch */
75 ce_notify_fct_t notify;
76 } ckrm_eng_callback_t;
81 typedef struct rbce_eng_callback {
82 int (*mkdir) (struct inode *, struct dentry *, int); /* mkdir */
83 int (*rmdir) (struct inode *, struct dentry *); /* rmdir */
86 } rbce_eng_callback_t;
88 extern int ckrm_register_engine(const char *name, ckrm_eng_callback_t *);
89 extern int ckrm_unregister_engine(const char *name);
91 extern void *ckrm_classobj(const char *, int *classtype);
92 extern int get_exe_path_name(struct task_struct *t, char *filename,
95 extern int rcfs_register_engine(rbce_eng_callback_t *);
96 extern int rcfs_unregister_engine(rbce_eng_callback_t *);
98 extern int ckrm_reclassify(int pid);
100 #ifndef _LINUX_CKRM_RC_H
102 extern void ckrm_core_grab(void *);
103 extern void ckrm_core_drop(void *);
106 #endif /* CONFIG_CKRM */
107 #endif /* __KERNEL__ */
108 #endif /* _LINUX_CKRM_CE_H */