xref: /reactos/base/services/nfsd/daemon_debug.h (revision 40462c92)
1 /* NFSv4.1 client for Windows
2  * Copyright � 2012 The Regents of the University of Michigan
3  *
4  * Olga Kornievskaia <aglo@umich.edu>
5  * Casey Bodley <cbodley@umich.edu>
6  *
7  * This library is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License as published by
9  * the Free Software Foundation; either version 2.1 of the License, or (at
10  * your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful, but
13  * without any warranty; without even the implied warranty of merchantability
14  * or fitness for a particular purpose.  See the GNU Lesser General Public
15  * License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this library; if not, write to the Free Software Foundation,
19  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20  */
21 
22 #ifndef _DAEMON_DEBUG_
23 #define _DAEMON_DEBUG_
24 
25 #ifdef _DEBUG
26 /* use visual studio's debug heap */
27 # define _CRTDBG_MAP_ALLOC
28 # include <stdlib.h>
29 # include <crtdbg.h>
30 #else
31 # include <stdlib.h>
32 #endif
33 
34 #define DEFAULT_DEBUG_LEVEL 1
35 
36 
37 /* daemon_debug.h */
38 void set_debug_level(int level);
39 void dprintf(int level, LPCSTR format, ...);
40 void eprintf(LPCSTR format, ...);
41 
42 void print_windows_access_mask(int on, ACCESS_MASK m);
43 void print_nfs_access_mask(int on, int m);
44 void print_hexbuf_no_asci(int on, unsigned char *title, unsigned char *buf, int len);
45 void print_hexbuf(int level, unsigned char *title, unsigned char *buf, int len);
46 void print_create_attributes(int level, DWORD create_opts);
47 void print_disposition(int level, DWORD disposition);
48 void print_access_mask(int level, DWORD access_mask);
49 void print_share_mode(int level, DWORD mode);
50 void print_file_id_both_dir_info(int level, FILE_ID_BOTH_DIR_INFO *p);
51 void print_opcode(int level, DWORD opcode);
52 const char* opcode2string(DWORD opcode);
53 const char* nfs_opnum_to_string(int opnum);
54 const char* nfs_error_string(int status);
55 const char* rpc_error_string(int status);
56 const char* gssauth_string(int type);
57 void print_condwait_status(int level, int status);
58 void print_sr_status_flags(int level, int flags);
59 void open_log_files();
60 void close_log_files();
61 const char* secflavorop2name(DWORD sec_flavor);
62 
63 /* pnfs_debug.c */
64 enum pnfs_status;
65 enum pnfs_layout_type;
66 enum pnfs_iomode;
67 struct __pnfs_file_layout;
68 struct __pnfs_file_device;
69 
70 const char* pnfs_error_string(enum pnfs_status status);
71 const char* pnfs_layout_type_string(enum pnfs_layout_type type);
72 const char* pnfs_iomode_string(enum pnfs_iomode iomode);
73 
74 void dprint_deviceid(int level, const char *title, const unsigned char *deviceid);
75 void dprint_layout(int level, const struct __pnfs_file_layout *layout);
76 void dprint_device(int level, const struct __pnfs_file_device *device);
77 
78 #endif
79