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