2 * @file us_manager/pf/proc_filters.h
3 * @author Vyacheslav Cherkashin <v.cherkashin@samsung.com>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 * Copyright (C) Samsung Electronics, 2013
25 #ifndef _PROC_FILTERS_H
26 #define _PROC_FILTERS_H
28 #include <linux/types.h>
35 * @breaf Filter for process
38 /** Callback for filtering */
39 struct task_struct *(*call)(struct proc_filter *self,
40 struct task_struct *task);
41 void *data; /**< Data of callback */
42 void *priv; /**< Private data */
46 * @def check_task_f @hideinitializer
47 * Call filter on the task
49 * @param filter Pointer to the proc_filter struct
50 * @param task Pointer to the task_struct struct
52 #define check_task_f(filter, task) ((filter)->call(filter, task))
54 void set_pf_by_dentry(struct proc_filter *pf, struct dentry *dentry,
56 void set_pf_by_tgid(struct proc_filter *pf, pid_t tgid, void *priv);
57 int set_pf_by_comm(struct proc_filter *pf, char *comm, void *priv);
58 void set_pf_dumb(struct proc_filter *pf, void *priv);
61 int check_pf_by_dentry(struct proc_filter *filter, struct dentry *dentry);
62 int check_pf_by_tgid(struct proc_filter *filter, pid_t tgid);
63 int check_pf_by_comm(struct proc_filter *filter, char *comm);
64 int check_pf_dumb(struct proc_filter *filter);
65 void *get_pf_priv(struct proc_filter *filter);
67 void free_pf(struct proc_filter *filter);
69 int ignore_pf(struct proc_filter *filter);
71 #endif /* _PROC_FILTERS_H */