Whamcloud - gitweb
Lproc-snmp code drop
[fs/lustre-release.git] / lustre / include / linux / lprocfs_status.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  *  Copyright (C) 2002 Cluster File Systems, Inc.
5  *
6  *   This file is part of Lustre, http://www.lustre.org.
7  *
8  *   Lustre is free software; you can redistribute it and/or
9  *   modify it under the terms of version 2 of the GNU General Public
10  *   License as published by the Free Software Foundation.
11  *
12  *   Lustre is distributed in the hope that it will be useful,
13  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *   GNU General Public License for more details.
16  *
17  *   You should have received a copy of the GNU General Public License
18  *   along with Lustre; if not, write to the Free Software
19  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  *   
21  *   Top level header file for LProc SNMP
22  */
23 #ifndef _LPROCFS_SNMP_H
24 #define _LPROCFS_SNMP_H
25
26 #ifndef LPROC_SNMP
27 #define LPROC_SNMP
28 #endif
29
30 #include <linux/proc_fs.h>
31
32
33 typedef struct lprocfs_vars{
34         char* name;
35         read_proc_t* read_fptr;
36         write_proc_t* write_fptr;
37 } lprocfs_vars_t;
38
39 #ifdef LPROC_SNMP
40
41 struct proc_dir_entry* lprocfs_mkdir(const char* dname,
42                                      struct proc_dir_entry *parent);
43 struct proc_dir_entry* lprocfs_srch(struct proc_dir_entry* head,
44                                     const char* name);
45 void lprocfs_remove_all(struct proc_dir_entry* root);
46 struct proc_dir_entry* lprocfs_new_dir(struct proc_dir_entry* root,
47                                        const char* string, 
48                                        const char* tok);
49 int lprocfs_new_vars(struct proc_dir_entry* root,
50                      lprocfs_vars_t* list,
51                      const char* tok, 
52                      void* data);
53 int lprocfs_add_vars(struct proc_dir_entry* root,
54                      lprocfs_vars_t* var, 
55                      void* data);
56 int lprocfs_reg_obd(struct obd_device* device, 
57                     lprocfs_vars_t* list, 
58                     void* data);
59 int lprocfs_dereg_obd(struct obd_device* device);
60 struct proc_dir_entry* lprocfs_reg_mnt(char *mnt_name);
61 int lprocfs_dereg_mnt(struct proc_dir_entry* root);
62 int lprocfs_reg_class(struct obd_type* type,
63                       lprocfs_vars_t* list, 
64                       void* data);
65 int lprocfs_dereg_class(struct obd_type* class);
66 int lprocfs_reg_main(void);
67 int lprocfs_dereg_main(void);
68 int lprocfs_ll_rd(char *page, char **start, off_t off,
69                   int count, int *eof, void *data);
70 #else
71
72
73 static inline int lprocfs_add_vars(struct proc_dir_entry* root,
74                                    lprocfs_vars_t* var, 
75                                    void* data)
76 {
77         return 0;
78 }
79
80 static inline int lprocfs_reg_obd(struct obd_device* device, 
81                                   lprocfs_vars_t* list, 
82                                   void* data)
83 {
84         return 0;
85 }
86
87 static inline int lprocfs_dereg_obd(struct obd_device* device)
88 {
89
90         return 0;
91 }
92
93 static inline struct proc_dir_entry* lprocfs_reg_mnt(char *name)
94 {
95         return 0;
96         
97 }
98
99 static inline int lprocfs_dereg_mnt(struct proc_dir_entry* root)
100 {
101         return 0;
102 }
103
104 static inline int lprocfs_reg_class(struct obd_type* type,
105                                                        lprocfs_vars_t* list, 
106                                                        void* data)
107 {
108         return 0;
109 }
110
111 static inline int lprocfs_dereg_class(struct obd_type* class)
112 {
113         return 0;
114
115 }
116 static inline int lprocfs_reg_main()
117 {
118         return 0;
119
120 }
121
122 static inline int lprocfs_dereg_main()
123 {
124         return 0;
125 }
126
127 static inline int lprocfs_ll_rd(char *page, char **start, off_t off,
128                                 int count, int *eof, void *data)
129 {
130         return 0;
131 }
132 #endif /* LPROC_SNMP */
133
134 #endif /* LPROCFS_SNMP_H */