Reactos
at master 78 lines 2.8 kB view raw
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 */ 38void set_debug_level(int level); 39void dprintf(int level, LPCSTR format, ...); 40void eprintf(LPCSTR format, ...); 41 42void print_windows_access_mask(int on, ACCESS_MASK m); 43void print_nfs_access_mask(int on, int m); 44void print_hexbuf_no_asci(int on, unsigned char *title, unsigned char *buf, int len); 45void print_hexbuf(int level, unsigned char *title, unsigned char *buf, int len); 46void print_create_attributes(int level, DWORD create_opts); 47void print_disposition(int level, DWORD disposition); 48void print_access_mask(int level, DWORD access_mask); 49void print_share_mode(int level, DWORD mode); 50void print_file_id_both_dir_info(int level, FILE_ID_BOTH_DIR_INFO *p); 51void print_opcode(int level, DWORD opcode); 52const char* opcode2string(DWORD opcode); 53const char* nfs_opnum_to_string(int opnum); 54const char* nfs_error_string(int status); 55const char* rpc_error_string(int status); 56const char* gssauth_string(int type); 57void print_condwait_status(int level, int status); 58void print_sr_status_flags(int level, int flags); 59void open_log_files(); 60void close_log_files(); 61const char* secflavorop2name(DWORD sec_flavor); 62 63/* pnfs_debug.c */ 64enum pnfs_status; 65enum pnfs_layout_type; 66enum pnfs_iomode; 67struct __pnfs_file_layout; 68struct __pnfs_file_device; 69 70const char* pnfs_error_string(enum pnfs_status status); 71const char* pnfs_layout_type_string(enum pnfs_layout_type type); 72const char* pnfs_iomode_string(enum pnfs_iomode iomode); 73 74void dprint_deviceid(int level, const char *title, const unsigned char *deviceid); 75void dprint_layout(int level, const struct __pnfs_file_layout *layout); 76void dprint_device(int level, const struct __pnfs_file_device *device); 77 78#endif