ReactOS  0.4.12-dev-18-gf469aca
daemon_debug.c File Reference
#include <windows.h>
#include <stdio.h>
#include "daemon_debug.h"
#include "from_kernel.h"
#include "nfs41_driver.h"
#include "nfs41_ops.h"
#include "service.h"
#include "rpc/rpc.h"
#include "rpc/auth_sspi.h"
Include dependency graph for daemon_debug.c:

Go to the source code of this file.

Functions

void set_debug_level (int level)
 
void open_log_files ()
 
void close_log_files ()
 
void dprintf (int level, LPCSTR format,...)
 
void eprintf (LPCSTR format,...)
 
void print_hexbuf (int level, unsigned char *title, unsigned char *buf, int len)
 
void print_hexbuf_no_asci (int level, unsigned char *title, unsigned char *buf, int len)
 
void print_create_attributes (int level, DWORD create_opts)
 
void print_disposition (int level, DWORD disposition)
 
void print_access_mask (int level, DWORD access_mask)
 
void print_share_mode (int level, DWORD mode)
 
void print_file_id_both_dir_info (int level, FILE_ID_BOTH_DIR_INFO *pboth_dir_info)
 
void print_opcode (int level, DWORD opcode)
 
const charopcode2string (DWORD opcode)
 
const charnfs_opnum_to_string (int opnum)
 
const charnfs_error_string (int status)
 
const charrpc_error_string (int status)
 
const chargssauth_string (int type)
 
void print_condwait_status (int level, int status)
 
void print_sr_status_flags (int level, int flags)
 
const charsecflavorop2name (DWORD sec_flavor)
 
void print_windows_access_mask (int on, ACCESS_MASK m)
 
void print_nfs_access_mask (int on, int m)
 

Variables

static int g_debug_level = DEFAULT_DEBUG_LEVEL
 
FILEdlog_file
 
FILEelog_file
 

Function Documentation

◆ close_log_files()

void close_log_files ( )

Definition at line 59 of file daemon_debug.c.

Referenced by ServiceStart().

60 {
63 }
FILE * dlog_file
Definition: daemon_debug.c:37
FILE * elog_file
Definition: daemon_debug.c:37
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)

◆ dprintf()

void dprintf ( int  level,
LPCSTR  format,
  ... 
)

Definition at line 72 of file daemon_debug.c.

Referenced by print_nfs_access_mask(), print_opcode(), and print_windows_access_mask().

73 {
74  if (level <= g_debug_level) {
75  va_list args;
76  va_start(args, format);
77  fprintf(dlog_file, "%04x: ", GetCurrentThreadId());
78  vfprintf(dlog_file, format, args);
79 #ifndef STANDALONE_NFSD
81 #endif
82  va_end(args);
83  }
84 }
GLint level
Definition: gl.h:1546
FILE * dlog_file
Definition: daemon_debug.c:37
static int g_debug_level
Definition: daemon_debug.c:33
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define va_end(ap)
Definition: acmsvcex.h:90
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
char * va_list
Definition: acmsvcex.h:78
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:421
_Check_return_opt_ _CRTIMP int __cdecl fflush(_Inout_opt_ FILE *_File)
#define va_start(ap, A)
Definition: acmsvcex.h:91
_Check_return_opt_ _CRTIMP int __cdecl vfprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format, va_list _ArgList)
#define args
Definition: format.c:66

◆ eprintf()

void eprintf ( LPCSTR  format,
  ... 
)

Definition at line 86 of file daemon_debug.c.

Referenced by abs_path_link(), check_execute_access(), compound_encode_send_decode(), config_defaults(), config_init(), config_load(), config_parse_pair(), convert_nfs4acl_2_dacl(), create_new_rpc_auth(), create_rpcsec_auth_client(), create_silly_rename(), create_unknownsid(), decode_layout(), decode_op_want_delegation(), decode_open_res_ok(), decode_space_limit4(), delegation_return(), encode_file_attrs(), encode_op_layoutreturn(), encode_open_claim4(), file_layout_read_thread(), file_layout_return(), file_layout_write_thread(), get_dense_fh(), get_ea_value(), get_sparse_fh(), get_superblock_attrs(), get_volume_size_info(), getdomainname(), handle_cb_compound(), handle_cb_sequence(), handle_getacl(), handle_getattr(), handle_mount(), handle_open(), handle_setacl(), handle_setattr(), handle_symlink(), handle_volume(), hash_mac_addrs(), idmap_filter(), idmap_lookup_group(), idmap_lookup_user(), idmap_query_attrs(), layout_update(), map_dacl_2_nfs4acl(), map_name_2_sid(), map_nfs4ace_who(), map_user_to_ids(), marshall_getattr(), mds_commit(), nfs41_cached_getattr(), nfs41_client_create(), nfs41_client_owner(), nfs41_client_renew(), nfs41_create_session(), nfs41_delegation_recall(), nfs41_delegation_to_open(), nfs41_destroy_session(), nfs41_ea_set(), nfs41_handle_callback(), nfs41_idmap_create(), nfs41_idmap_gid_to_group(), nfs41_idmap_uid_to_name(), nfs41_lookup(), nfs41_read(), nfs41_recover_session(), nfs41_recover_stateid(), nfs41_root_create(), nfs41_root_mount_addrs(), nfs41_rpc_clnt_create(), nfs41_send_compound(), nfs41_session_bad_slot(), nfs41_session_create(), nfs41_session_free(), nfs41_session_set_lease(), nfs41_symlink_target(), nfs41_write(), nfs_decode_compound(), nfs_to_windows_error(), pattern_fork(), pnfs_file_device_get(), pnfs_layout_state_close(), pnfs_read(), pnfs_write(), readdir_copy_entry(), readdir_size_for_entry(), recover_delegation_open(), recover_delegation_want(), recover_open(), referral_resolve(), replay_cache_read(), root_client_create(), rpc_reconnect(), server_create(), ServiceStart(), session_get_lease(), set_ea_value(), superblock_create(), thread_main(), unexpected_op(), upcall_handle(), upcall_parse(), xdr_bitmap4(), xdr_channel_attrs4(), xdr_layout_types(), xdr_locker4(), xdr_state_protect4_a(), and xdr_state_protect4_r().

87 {
88  va_list args;
89  va_start(args, format);
90  fprintf(elog_file, "%04x: ", GetCurrentThreadId());
91  vfprintf(elog_file, format, args);
92 #ifndef STANDALONE_NFSD
94 #endif
95  va_end(args);
96 }
FILE * elog_file
Definition: daemon_debug.c:37
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define va_end(ap)
Definition: acmsvcex.h:90
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
char * va_list
Definition: acmsvcex.h:78
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:421
_Check_return_opt_ _CRTIMP int __cdecl fflush(_Inout_opt_ FILE *_File)
#define va_start(ap, A)
Definition: acmsvcex.h:91
_Check_return_opt_ _CRTIMP int __cdecl vfprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format, va_list _ArgList)
#define args
Definition: format.c:66

◆ gssauth_string()

const char* gssauth_string ( int  type)

Definition at line 504 of file daemon_debug.c.

Referenced by create_new_rpc_auth().

504  {
505  switch(type) {
506  case RPCSEC_SSPI_SVC_NONE: return "RPCSEC_SSPI_SVC_NONE";
507  case RPCSEC_SSPI_SVC_INTEGRITY: return "RPCSEC_SSPI_SVC_INTEGRITY";
508  case RPCSEC_SSPI_SVC_PRIVACY: return "RPCSEC_SSPI_SVC_PRIVACY";
509  default: return "invalid gss auth type";
510  }
511 }
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545

◆ nfs_error_string()

const char* nfs_error_string ( int  status)

Definition at line 370 of file daemon_debug.c.

Referenced by cancel_open(), check_execute_access(), compound_encode_send_decode(), do_nfs41_close(), file_layout_fetch(), file_layout_read_thread(), file_layout_return(), file_layout_write_thread(), get_ea_value(), get_superblock_attrs(), get_volume_size_info(), handle_cb_compound(), handle_cb_layoutrecall(), handle_cb_recall_slot(), handle_cb_sequence(), handle_close(), handle_lock(), handle_nfs41_remove(), handle_nfs41_set_size(), handle_open(), handle_readdir(), handle_setacl(), handle_setexattr(), handle_symlink(), layout_commit(), mds_commit(), nfs41_cached_getattr(), nfs41_delegation_getattr(), nfs41_delegation_recall(), nfs41_delegation_to_open(), nfs41_ea_set(), nfs41_read(), nfs41_root_mount_addrs(), nfs41_symlink_target(), nfs41_write(), nfs_to_windows_error(), pnfs_file_device_get(), referral_resolve(), root_client_create(), rpc_reconnect(), session_get_lease(), and set_ea_value().

371 {
372  switch (status)
373  {
374  case NFS4_OK: return "NFS4_OK";
375  case NFS4ERR_PERM: return "NFS4ERR_PERM";
376  case NFS4ERR_NOENT: return "NFS4ERR_NOENT";
377  case NFS4ERR_IO: return "NFS4ERR_IO";
378  case NFS4ERR_NXIO: return "NFS4ERR_NXIO";
379  case NFS4ERR_ACCESS: return "NFS4ERR_ACCESS";
380  case NFS4ERR_EXIST: return "NFS4ERR_EXIST";
381  case NFS4ERR_XDEV: return "NFS4ERR_XDEV";
382  case NFS4ERR_NOTDIR: return "NFS4ERR_NOTDIR";
383  case NFS4ERR_ISDIR: return "NFS4ERR_ISDIR";
384  case NFS4ERR_INVAL: return "NFS4ERR_INVAL";
385  case NFS4ERR_FBIG: return "NFS4ERR_FBIG";
386  case NFS4ERR_NOSPC: return "NFS4ERR_NOSPC";
387  case NFS4ERR_ROFS: return "NFS4ERR_ROFS";
388  case NFS4ERR_MLINK: return "NFS4ERR_MLINK";
389  case NFS4ERR_NAMETOOLONG: return "NFS4ERR_NAMETOOLONG";
390  case NFS4ERR_NOTEMPTY: return "NFS4ERR_NOTEMPTY";
391  case NFS4ERR_DQUOT: return "NFS4ERR_DQUOT";
392  case NFS4ERR_STALE: return "NFS4ERR_STALE";
393  case NFS4ERR_BADHANDLE: return "NFS4ERR_BADHANDLE";
394  case NFS4ERR_BAD_COOKIE: return "NFS4ERR_BAD_COOKIE";
395  case NFS4ERR_NOTSUPP: return "NFS4ERR_NOTSUPP";
396  case NFS4ERR_TOOSMALL: return "NFS4ERR_TOOSMALL";
397  case NFS4ERR_SERVERFAULT: return "NFS4ERR_SERVERFAULT";
398  case NFS4ERR_BADTYPE: return "NFS4ERR_BADTYPE";
399  case NFS4ERR_DELAY: return "NFS4ERR_DELAY";
400  case NFS4ERR_SAME: return "NFS4ERR_SAME";
401  case NFS4ERR_DENIED: return "NFS4ERR_DENIED";
402  case NFS4ERR_EXPIRED: return "NFS4ERR_EXPIRED";
403  case NFS4ERR_LOCKED: return "NFS4ERR_LOCKED";
404  case NFS4ERR_GRACE: return "NFS4ERR_GRACE";
405  case NFS4ERR_FHEXPIRED: return "NFS4ERR_FHEXPIRED";
406  case NFS4ERR_SHARE_DENIED: return "NFS4ERR_SHARE_DENIED";
407  case NFS4ERR_WRONGSEC: return "NFS4ERR_WRONGSEC";
408  case NFS4ERR_CLID_INUSE: return "NFS4ERR_CLID_INUSE";
409  case NFS4ERR_RESOURCE: return "NFS4ERR_RESOURCE";
410  case NFS4ERR_MOVED: return "NFS4ERR_MOVED";
411  case NFS4ERR_NOFILEHANDLE: return "NFS4ERR_NOFILEHANDLE";
412  case NFS4ERR_MINOR_VERS_MISMATCH: return "NFS4ERR_MINOR_VERS_MISMATCH";
413  case NFS4ERR_STALE_CLIENTID: return "NFS4ERR_STALE_CLIENTID";
414  case NFS4ERR_STALE_STATEID: return "NFS4ERR_STALE_STATEID";
415  case NFS4ERR_OLD_STATEID: return "NFS4ERR_OLD_STATEID";
416  case NFS4ERR_BAD_STATEID: return "NFS4ERR_BAD_STATEID";
417  case NFS4ERR_BAD_SEQID: return "NFS4ERR_BAD_SEQID";
418  case NFS4ERR_NOT_SAME: return "NFS4ERR_NOT_SAME";
419  case NFS4ERR_LOCK_RANGE: return "NFS4ERR_LOCK_RANGE";
420  case NFS4ERR_SYMLINK: return "NFS4ERR_SYMLINK";
421  case NFS4ERR_RESTOREFH: return "NFS4ERR_RESTOREFH";
422  case NFS4ERR_LEASE_MOVED: return "NFS4ERR_LEASE_MOVED";
423  case NFS4ERR_ATTRNOTSUPP: return "NFS4ERR_ATTRNOTSUPP";
424  case NFS4ERR_NO_GRACE: return "NFS4ERR_NO_GRACE";
425  case NFS4ERR_RECLAIM_BAD: return "NFS4ERR_RECLAIM_BAD";
426  case NFS4ERR_RECLAIM_CONFLICT: return "NFS4ERR_RECLAIM_CONFLICT";
427  case NFS4ERR_BADXDR: return "NFS4ERR_BADXDR";
428  case NFS4ERR_LOCKS_HELD: return "NFS4ERR_LOCKS_HELD";
429  case NFS4ERR_OPENMODE: return "NFS4ERR_OPENMODE";
430  case NFS4ERR_BADOWNER: return "NFS4ERR_BADOWNER";
431  case NFS4ERR_BADCHAR: return "NFS4ERR_BADCHAR";
432  case NFS4ERR_BADNAME: return "NFS4ERR_BADNAME";
433  case NFS4ERR_BAD_RANGE: return "NFS4ERR_BAD_RANGE";
434  case NFS4ERR_LOCK_NOTSUPP: return "NFS4ERR_LOCK_NOTSUPP";
435  case NFS4ERR_OP_ILLEGAL: return "NFS4ERR_OP_ILLEGAL";
436  case NFS4ERR_DEADLOCK: return "NFS4ERR_DEADLOCK";
437  case NFS4ERR_FILE_OPEN: return "NFS4ERR_FILE_OPEN";
438  case NFS4ERR_ADMIN_REVOKED: return "NFS4ERR_ADMIN_REVOKED";
439  case NFS4ERR_CB_PATH_DOWN: return "NFS4ERR_CB_PATH_DOWN";
440  case NFS4ERR_BADIOMODE: return "NFS4ERR_BADIOMODE";
441  case NFS4ERR_BADLAYOUT: return "NFS4ERR_BADLAYOUT";
442  case NFS4ERR_BAD_SESSION_DIGEST: return "NFS4ERR_BAD_SESSION_DIGEST";
443  case NFS4ERR_BADSESSION: return "NFS4ERR_BADSESSION";
444  case NFS4ERR_BADSLOT: return "NFS4ERR_BADSLOT";
445  case NFS4ERR_COMPLETE_ALREADY: return "NFS4ERR_COMPLETE_ALREADY";
446  case NFS4ERR_CONN_NOT_BOUND_TO_SESSION: return "NFS4ERR_CONN_NOT_BOUND_TO_SESSION";
447  case NFS4ERR_DELEG_ALREADY_WANTED: return "NFS4ERR_DELEG_ALREADY_WANTED";
448  case NFS4ERR_BACK_CHAN_BUSY: return "NFS4ERR_BACK_CHAN_BUSY";
449  case NFS4ERR_LAYOUTTRYLATER: return "NFS4ERR_LAYOUTTRYLATER";
450  case NFS4ERR_LAYOUTUNAVAILABLE: return "NFS4ERR_LAYOUTUNAVAILABLE";
451  case NFS4ERR_NOMATCHING_LAYOUT: return "NFS4ERR_NOMATCHING_LAYOUT";
452  case NFS4ERR_RECALLCONFLICT: return "NFS4ERR_RECALLCONFLICT";
453  case NFS4ERR_UNKNOWN_LAYOUTTYPE: return "NFS4ERR_UNKNOWN_LAYOUTTYPE";
454  case NFS4ERR_SEQ_MISORDERED: return "NFS4ERR_SEQ_MISORDERED";
455  case NFS4ERR_SEQUENCE_POS: return "NFS4ERR_SEQUENCE_POS";
456  case NFS4ERR_REQ_TOO_BIG: return "NFS4ERR_REQ_TOO_BIG";
457  case NFS4ERR_REP_TOO_BIG: return "NFS4ERR_REP_TOO_BIG";
458  case NFS4ERR_REP_TOO_BIG_TO_CACHE: return "NFS4ERR_REP_TOO_BIG_TO_CACHE";
459  case NFS4ERR_RETRY_UNCACHED_REP: return "NFS4ERR_RETRY_UNCACHED_REP";
460  case NFS4ERR_UNSAFE_COMPOUND: return "NFS4ERR_UNSAFE_COMPOUND";
461  case NFS4ERR_TOO_MANY_OPS: return "NFS4ERR_TOO_MANY_OPS";
462  case NFS4ERR_OP_NOT_IN_SESSION: return "NFS4ERR_OP_NOT_IN_SESSION";
463  case NFS4ERR_HASH_ALG_UNSUPP: return "NFS4ERR_HASH_ALG_UNSUPP";
464  case NFS4ERR_CLIENTID_BUSY: return "NFS4ERR_CLIENTID_BUSY";
465  case NFS4ERR_PNFS_IO_HOLE: return "NFS4ERR_PNFS_IO_HOLE";
466  case NFS4ERR_SEQ_FALSE_RETRY: return "NFS4ERR_SEQ_FALSE_RETRY";
467  case NFS4ERR_BAD_HIGH_SLOT: return "NFS4ERR_BAD_HIGH_SLOT";
468  case NFS4ERR_DEADSESSION: return "NFS4ERR_DEADSESSION";
469  case NFS4ERR_ENCR_ALG_UNSUPP: return "NFS4ERR_ENCR_ALG_UNSUPP";
470  case NFS4ERR_PNFS_NO_LAYOUT: return "NFS4ERR_PNFS_NO_LAYOUT";
471  case NFS4ERR_NOT_ONLY_OP: return "NFS4ERR_NOT_ONLY_OP";
472  case NFS4ERR_WRONG_CRED: return "NFS4ERR_WRONG_CRED";
473  case NFS4ERR_WRONG_TYPE: return "NFS4ERR_WRONG_TYPE";
474  case NFS4ERR_DIRDELEG_UNAVAIL: return "NFS4ERR_DIRDELEG_UNAVAIL";
475  case NFS4ERR_REJECT_DELEG: return "NFS4ERR_REJECT_DELEG";
476  case NFS4ERR_RETURNCONFLICT: return "NFS4ERR_RETURNCONFLICT";
477  case NFS4ERR_DELEG_REVOKED: return "NFS4ERR_DELEG_REVOKED";
478  default: return "invalid nfs error code";
479  }
480 }
Definition: ps.c:97

◆ nfs_opnum_to_string()

const char* nfs_opnum_to_string ( int  opnum)

Definition at line 305 of file daemon_debug.c.

Referenced by nfs41_destroy_session(), nfs41_recover_stateid(), nfs_decode_compound(), and unexpected_op().

306 {
307  switch (opnum)
308  {
309  case OP_ACCESS: return "ACCESS";
310  case OP_CLOSE: return "CLOSE";
311  case OP_COMMIT: return "COMMIT";
312  case OP_CREATE: return "CREATE";
313  case OP_DELEGPURGE: return "DELEGPURGE";
314  case OP_DELEGRETURN: return "DELEGRETURN";
315  case OP_GETATTR: return "GETATTR";
316  case OP_GETFH: return "GETFH";
317  case OP_LINK: return "LINK";
318  case OP_LOCK: return "LOCK";
319  case OP_LOCKT: return "LOCKT";
320  case OP_LOCKU: return "LOCKU";
321  case OP_LOOKUP: return "LOOKUP";
322  case OP_LOOKUPP: return "LOOKUPP";
323  case OP_NVERIFY: return "NVERIFY";
324  case OP_OPEN: return "OPEN";
325  case OP_OPENATTR: return "OPENATTR";
326  case OP_OPEN_CONFIRM: return "OPEN_CONFIRM";
327  case OP_OPEN_DOWNGRADE: return "OPEN_DOWNGRADE";
328  case OP_PUTFH: return "PUTFH";
329  case OP_PUTPUBFH: return "PUTPUBFH";
330  case OP_PUTROOTFH: return "PUTROOTFH";
331  case OP_READ: return "READ";
332  case OP_READDIR: return "READDIR";
333  case OP_READLINK: return "READLINK";
334  case OP_REMOVE: return "REMOVE";
335  case OP_RENAME: return "RENAME";
336  case OP_RENEW: return "RENEW";
337  case OP_RESTOREFH: return "RESTOREFH";
338  case OP_SAVEFH: return "SAVEFH";
339  case OP_SECINFO: return "SECINFO";
340  case OP_SETATTR: return "SETATTR";
341  case OP_SETCLIENTID: return "SETCLIENTID";
342  case OP_SETCLIENTID_CONFIRM: return "SETCLIENTID_CONFIRM";
343  case OP_VERIFY: return "VERIFY";
344  case OP_WRITE: return "WRITE";
345  case OP_RELEASE_LOCKOWNER: return "RELEASE_LOCKOWNER";
346  case OP_BACKCHANNEL_CTL: return "BACKCHANNEL_CTL";
347  case OP_BIND_CONN_TO_SESSION: return "BIND_CONN_TO_SESSION";
348  case OP_EXCHANGE_ID: return "EXCHANGE_ID";
349  case OP_CREATE_SESSION: return "CREATE_SESSION";
350  case OP_DESTROY_SESSION: return "DESTROY_SESSION";
351  case OP_FREE_STATEID: return "FREE_STATEID";
352  case OP_GET_DIR_DELEGATION: return "GET_DIR_DELEGATION";
353  case OP_GETDEVICEINFO: return "GETDEVICEINFO";
354  case OP_GETDEVICELIST: return "GETDEVICELIST";
355  case OP_LAYOUTCOMMIT: return "LAYOUTCOMMIT";
356  case OP_LAYOUTGET: return "LAYOUTGET";
357  case OP_LAYOUTRETURN: return "LAYOUTRETURN";
358  case OP_SECINFO_NO_NAME: return "SECINFO_NO_NAME";
359  case OP_SEQUENCE: return "SEQUENCE";
360  case OP_SET_SSV: return "SET_SSV";
361  case OP_TEST_STATEID: return "TEST_STATEID";
362  case OP_WANT_DELEGATION: return "WANT_DELEGATION";
363  case OP_DESTROY_CLIENTID: return "DESTROY_CLIENTID";
364  case OP_RECLAIM_COMPLETE: return "RECLAIM_COMPLETE";
365  case OP_ILLEGAL: return "ILLEGAL";
366  default: return "invalid nfs opnum";
367  }
368 }

◆ opcode2string()

const char* opcode2string ( DWORD  opcode)

Definition at line 280 of file daemon_debug.c.

Referenced by marshal_nfs41_header(), nfs41_UpcallWaitForReply(), parse_rw(), print_opcode(), thread_main(), unmarshal_nfs41_header(), upcall_handle(), and upcall_parse().

281 {
282  switch(opcode) {
283  case NFS41_SHUTDOWN: return "NFS41_SHUTDOWN";
284  case NFS41_MOUNT: return "NFS41_MOUNT";
285  case NFS41_UNMOUNT: return "NFS41_UNMOUNT";
286  case NFS41_OPEN: return "NFS41_OPEN";
287  case NFS41_CLOSE: return "NFS41_CLOSE";
288  case NFS41_READ: return "NFS41_READ";
289  case NFS41_WRITE: return "NFS41_WRITE";
290  case NFS41_LOCK: return "NFS41_LOCK";
291  case NFS41_UNLOCK: return "NFS41_UNLOCK";
292  case NFS41_DIR_QUERY: return "NFS41_DIR_QUERY";
293  case NFS41_FILE_QUERY: return "NFS41_FILE_QUERY";
294  case NFS41_FILE_SET: return "NFS41_FILE_SET";
295  case NFS41_EA_SET: return "NFS41_EA_SET";
296  case NFS41_EA_GET: return "NFS41_EA_GET";
297  case NFS41_SYMLINK: return "NFS41_SYMLINK";
298  case NFS41_VOLUME_QUERY: return "NFS41_VOLUME_QUERY";
299  case NFS41_ACL_QUERY: return "NFS41_ACL_QUERY";
300  case NFS41_ACL_SET: return "NFS41_ACL_SET";
301  default: return "UNKNOWN";
302  }
303 }
GLenum GLclampf GLint GLenum GLuint GLenum GLenum GLsizei GLenum const GLvoid GLfloat GLfloat GLfloat GLfloat GLclampd GLint GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean GLboolean GLboolean GLboolean GLint GLenum GLsizei const GLvoid GLenum GLint GLenum GLint GLint GLsizei GLint GLenum GLint GLint GLint GLint GLsizei GLenum GLsizei const GLuint GLboolean GLenum GLenum GLint GLsizei GLenum GLsizei GLenum const GLvoid GLboolean const GLboolean GLenum const GLdouble const GLfloat const GLdouble const GLfloat GLenum GLint GLint GLint GLint GLint GLint GLenum GLfloat GLenum GLint GLenum GLsizei GLenum GLboolean GLenum GLdouble GLenum GLfloat GLenum GLenum GLfloat GLenum GLenum GLdouble GLenum GLenum GLint GLenum GLenum GLint GLenum GLuint GLenum GLvoid const GLubyte GLenum GLenum GLenum GLint GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLvoid GLenum GLint GLenum GLint GLenum GLenum GLint GLuint GLdouble GLfloat GLint GLshort GLubyte GLenum GLuint GLenum const GLfloat GLenum const GLint GLenum GLenum const GLfloat GLenum GLenum const GLint GLfloat const GLfloat GLenum opcode
Definition: glfuncs.h:172

◆ open_log_files()

void open_log_files ( )

Definition at line 40 of file daemon_debug.c.

Referenced by close_log_files(), and ServiceStart().

41 {
42  const char dfile[] = "nfsddbg.log";
43  const char efile[] = "nfsderr.log";
44  const char mode[] = "w";
45  if (g_debug_level > 0) {
46  dlog_file = fopen(dfile, mode);
47  if (dlog_file == NULL) {
49  exit (GetLastError());
50  }
51  }
52  elog_file = fopen(efile, mode);
53  if (elog_file == NULL) {
55  exit (GetLastError());
56  }
57 }
FILE * dlog_file
Definition: daemon_debug.c:37
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
FILE * elog_file
Definition: daemon_debug.c:37
static int g_debug_level
Definition: daemon_debug.c:33
#define SERVICE_STOPPED
Definition: winsvc.h:21
smooth NULL
Definition: ftsmooth.c:416
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
void exit(int exitcode)
Definition: _exit.c:33
BOOL ReportStatusToSCMgr(DWORD dwCurrentState, DWORD dwWin32ExitCode, DWORD dwWaitHint)
Definition: service.c:240

◆ print_access_mask()

void print_access_mask ( int  level,
DWORD  access_mask 
)

Definition at line 181 of file daemon_debug.c.

Referenced by parse_open().

181  {
182  if (level > g_debug_level) return;
183  fprintf(dlog_file, "access mask: ");
184  if (access_mask & FILE_READ_DATA)
185  fprintf(dlog_file, "READ ");
186  if (access_mask & STANDARD_RIGHTS_READ)
187  fprintf(dlog_file, "READ_ACL ");
188  if (access_mask & FILE_READ_ATTRIBUTES)
189  fprintf(dlog_file, "READ_ATTR ");
190  if (access_mask & FILE_READ_EA)
191  fprintf(dlog_file, "READ_EA ");
192  if (access_mask & FILE_WRITE_DATA)
193  fprintf(dlog_file, "WRITE ");
194  if (access_mask & STANDARD_RIGHTS_WRITE)
195  fprintf(dlog_file, "WRITE_ACL ");
196  if (access_mask & FILE_WRITE_ATTRIBUTES)
197  fprintf(dlog_file, "WRITE_ATTR ");
198  if (access_mask & FILE_WRITE_EA)
199  fprintf(dlog_file, "WRITE_EA ");
200  if (access_mask & FILE_APPEND_DATA)
201  fprintf(dlog_file, "APPEND ");
202  if (access_mask & FILE_EXECUTE)
203  fprintf(dlog_file, "EXECUTE ");
204  if (access_mask & FILE_LIST_DIRECTORY)
205  fprintf(dlog_file, "LIST ");
206  if (access_mask & FILE_TRAVERSE)
207  fprintf(dlog_file, "TRAVERSE ");
208  if (access_mask & SYNCHRONIZE)
209  fprintf(dlog_file, "SYNC ");
210  if (access_mask & FILE_DELETE_CHILD)
211  fprintf(dlog_file, "DELETE_CHILD");
212  fprintf(dlog_file, "\n");
213 }
#define FILE_WRITE_EA
Definition: nt_native.h:640
GLint level
Definition: gl.h:1546
#define STANDARD_RIGHTS_WRITE
Definition: nt_native.h:66
FILE * dlog_file
Definition: daemon_debug.c:37
#define FILE_APPEND_DATA
Definition: nt_native.h:634
static int g_debug_level
Definition: daemon_debug.c:33
#define FILE_WRITE_ATTRIBUTES
Definition: nt_native.h:649
#define FILE_TRAVERSE
Definition: nt_native.h:643
#define FILE_DELETE_CHILD
Definition: nt_native.h:645
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
#define FILE_READ_DATA
Definition: nt_native.h:628
#define FILE_WRITE_DATA
Definition: nt_native.h:631
#define FILE_LIST_DIRECTORY
Definition: nt_native.h:629
#define FILE_READ_ATTRIBUTES
Definition: nt_native.h:647
#define FILE_EXECUTE
Definition: nt_native.h:642
#define STANDARD_RIGHTS_READ
Definition: nt_native.h:65
#define SYNCHRONIZE
Definition: nt_native.h:61
#define FILE_READ_EA
Definition: nt_native.h:638

◆ print_condwait_status()

void print_condwait_status ( int  level,
int  status 
)

Definition at line 513 of file daemon_debug.c.

Referenced by nfs41_send_compound().

514 {
515  if (level > g_debug_level) return;
516  switch(status) {
517  case WAIT_ABANDONED: fprintf(dlog_file, "WAIT_ABANDONED\n"); break;
518  case WAIT_OBJECT_0: fprintf(dlog_file, "WAIT_OBJECT_0\n"); break;
519  case WAIT_TIMEOUT: fprintf(dlog_file, "WAIT_TIMEOUT\n"); break;
520  case WAIT_FAILED: fprintf(dlog_file, "WAIT_FAILED %d\n", GetLastError());
521  default: fprintf(dlog_file, "unknown status =%d\n", status);
522  }
523 }
GLint level
Definition: gl.h:1546
#define WAIT_ABANDONED
Definition: winbase.h:393
FILE * dlog_file
Definition: daemon_debug.c:37
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static int g_debug_level
Definition: daemon_debug.c:33
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
#define WAIT_OBJECT_0
Definition: winbase.h:387
#define WAIT_FAILED
Definition: winbase.h:394
#define WAIT_TIMEOUT
Definition: dderror.h:14
Definition: ps.c:97

◆ print_create_attributes()

void print_create_attributes ( int  level,
DWORD  create_opts 
)

Definition at line 126 of file daemon_debug.c.

Referenced by parse_open().

126  {
127  if (level > g_debug_level) return;
128  fprintf(dlog_file, "create attributes: ");
129  if (create_opts & FILE_DIRECTORY_FILE)
130  fprintf(dlog_file, "DIRECTORY_FILE ");
131  if (create_opts & FILE_NON_DIRECTORY_FILE)
132  fprintf(dlog_file, "NON_DIRECTORY_FILE ");
133  if (create_opts & FILE_WRITE_THROUGH)
134  fprintf(dlog_file, "WRITE_THROUGH ");
135  if (create_opts & FILE_SEQUENTIAL_ONLY)
136  fprintf(dlog_file, "SEQUENTIAL_ONLY ");
137  if (create_opts & FILE_RANDOM_ACCESS)
138  fprintf(dlog_file, "RANDOM_ACCESS ");
139  if (create_opts & FILE_NO_INTERMEDIATE_BUFFERING)
140  fprintf(dlog_file, "NO_INTERMEDIATE_BUFFERING ");
141  if (create_opts & FILE_SYNCHRONOUS_IO_ALERT)
142  fprintf(dlog_file, "SYNCHRONOUS_IO_ALERT ");
143  if (create_opts & FILE_SYNCHRONOUS_IO_NONALERT)
144  fprintf(dlog_file, "SYNCHRONOUS_IO_NONALERT ");
145  if (create_opts & FILE_CREATE_TREE_CONNECTION)
146  fprintf(dlog_file, "CREATE_TREE_CONNECTION ");
147  if (create_opts & FILE_COMPLETE_IF_OPLOCKED)
148  fprintf(dlog_file, "COMPLETE_IF_OPLOCKED ");
149  if (create_opts & FILE_NO_EA_KNOWLEDGE)
150  fprintf(dlog_file, "NO_EA_KNOWLEDGE ");
151  if (create_opts & FILE_OPEN_REPARSE_POINT)
152  fprintf(dlog_file, "OPEN_REPARSE_POINT ");
153  if (create_opts & FILE_DELETE_ON_CLOSE)
154  fprintf(dlog_file, "DELETE_ON_CLOSE ");
155  if (create_opts & FILE_OPEN_BY_FILE_ID)
156  fprintf(dlog_file, "OPEN_BY_FILE_ID ");
157  if (create_opts & FILE_OPEN_FOR_BACKUP_INTENT)
158  fprintf(dlog_file, "OPEN_FOR_BACKUP_INTENT ");
159  if (create_opts & FILE_RESERVE_OPFILTER)
160  fprintf(dlog_file, "RESERVE_OPFILTER");
161  fprintf(dlog_file, "\n");
162 }
GLint level
Definition: gl.h:1546
#define FILE_SEQUENTIAL_ONLY
Definition: from_kernel.h:27
#define FILE_DIRECTORY_FILE
Definition: constants.h:491
FILE * dlog_file
Definition: daemon_debug.c:37
static int g_debug_level
Definition: daemon_debug.c:33
#define FILE_RESERVE_OPFILTER
Definition: from_kernel.h:45
#define FILE_OPEN_BY_FILE_ID
Definition: from_kernel.h:41
#define FILE_NO_INTERMEDIATE_BUFFERING
Definition: from_kernel.h:28
#define FILE_SYNCHRONOUS_IO_ALERT
Definition: from_kernel.h:30
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
#define FILE_NO_EA_KNOWLEDGE
Definition: from_kernel.h:36
#define FILE_WRITE_THROUGH
Definition: from_kernel.h:26
#define FILE_DELETE_ON_CLOSE
Definition: constants.h:494
#define FILE_NON_DIRECTORY_FILE
Definition: constants.h:492
#define FILE_OPEN_FOR_BACKUP_INTENT
Definition: from_kernel.h:42
#define FILE_RANDOM_ACCESS
Definition: from_kernel.h:38
#define FILE_SYNCHRONOUS_IO_NONALERT
Definition: from_kernel.h:31
#define FILE_CREATE_TREE_CONNECTION
Definition: from_kernel.h:33
#define FILE_OPEN_REPARSE_POINT
Definition: from_kernel.h:46
#define FILE_COMPLETE_IF_OPLOCKED
Definition: constants.h:493

◆ print_disposition()

void print_disposition ( int  level,
DWORD  disposition 
)

Definition at line 164 of file daemon_debug.c.

Referenced by parse_open().

164  {
165  if (level > g_debug_level) return;
166  fprintf(dlog_file, "userland disposition = ");
167  if (disposition == FILE_SUPERSEDE)
168  fprintf(dlog_file, "FILE_SUPERSEDE\n");
169  else if (disposition == FILE_CREATE)
170  fprintf(dlog_file, "FILE_CREATE\n");
171  else if (disposition == FILE_OPEN)
172  fprintf(dlog_file, "FILE_OPEN\n");
173  else if (disposition == FILE_OPEN_IF)
174  fprintf(dlog_file, "FILE_OPEN_IF\n");
175  else if (disposition == FILE_OVERWRITE)
176  fprintf(dlog_file, "FILE_OVERWRITE\n");
177  else if (disposition == FILE_OVERWRITE_IF)
178  fprintf(dlog_file, "FILE_OVERWRITE_IF\n");
179 }
GLint level
Definition: gl.h:1546
#define FILE_OPEN_IF
Definition: from_kernel.h:56
#define FILE_CREATE
Definition: from_kernel.h:55
FILE * dlog_file
Definition: daemon_debug.c:37
#define FILE_OVERWRITE
Definition: from_kernel.h:57
static int g_debug_level
Definition: daemon_debug.c:33
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
#define FILE_OVERWRITE_IF
Definition: from_kernel.h:58
#define FILE_OPEN
Definition: from_kernel.h:54
#define FILE_SUPERSEDE
Definition: from_kernel.h:53

◆ print_file_id_both_dir_info()

void print_file_id_both_dir_info ( int  level,
FILE_ID_BOTH_DIR_INFO *  pboth_dir_info 
)

Definition at line 228 of file daemon_debug.c.

229 {
230  if (level > g_debug_level) return;
231  fprintf(dlog_file, "FILE_ID_BOTH_DIR_INFO %p %d\n",
232  pboth_dir_info, sizeof(unsigned char *));
233  fprintf(dlog_file, "\tNextEntryOffset=%ld %d %d\n",
234  pboth_dir_info->NextEntryOffset,
235  sizeof(pboth_dir_info->NextEntryOffset), sizeof(DWORD));
236  fprintf(dlog_file, "\tFileIndex=%ld %d\n", pboth_dir_info->FileIndex,
237  sizeof(pboth_dir_info->FileIndex));
238  fprintf(dlog_file, "\tCreationTime=0x%x %d\n",
239  pboth_dir_info->CreationTime.QuadPart,
240  sizeof(pboth_dir_info->CreationTime));
241  fprintf(dlog_file, "\tLastAccessTime=0x%x %d\n",
242  pboth_dir_info->LastAccessTime.QuadPart,
243  sizeof(pboth_dir_info->LastAccessTime));
244  fprintf(dlog_file, "\tLastWriteTime=0x%x %d\n",
245  pboth_dir_info->LastWriteTime.QuadPart,
246  sizeof(pboth_dir_info->LastWriteTime));
247  fprintf(dlog_file, "\tChangeTime=0x%x %d\n",
248  pboth_dir_info->ChangeTime.QuadPart,
249  sizeof(pboth_dir_info->ChangeTime));
250  fprintf(dlog_file, "\tEndOfFile=0x%x %d\n",
251  pboth_dir_info->EndOfFile.QuadPart,
252  sizeof(pboth_dir_info->EndOfFile));
253  fprintf(dlog_file, "\tAllocationSize=0x%x %d\n",
254  pboth_dir_info->AllocationSize.QuadPart,
255  sizeof(pboth_dir_info->AllocationSize));
256  fprintf(dlog_file, "\tFileAttributes=%ld %d\n",
257  pboth_dir_info->FileAttributes,
258  sizeof(pboth_dir_info->FileAttributes));
259  fprintf(dlog_file, "\tFileNameLength=%ld %d\n",
260  pboth_dir_info->FileNameLength,
261  sizeof(pboth_dir_info->FileNameLength));
262  fprintf(dlog_file, "\tEaSize=%ld %d\n",
263  pboth_dir_info->EaSize, sizeof(pboth_dir_info->EaSize));
264  fprintf(dlog_file, "\tShortNameLength=%d %d\n",
265  pboth_dir_info->ShortNameLength,
266  sizeof(pboth_dir_info->ShortNameLength));
267  fprintf(dlog_file, "\tShortName='%S' %d\n", pboth_dir_info->ShortName,
268  sizeof(pboth_dir_info->ShortName));
269  fprintf(dlog_file, "\tFileId=0x%x %d\n", pboth_dir_info->FileId.QuadPart,
270  sizeof(pboth_dir_info->FileId));
271  fprintf(dlog_file, "\tFileName='%S' %p\n", pboth_dir_info->FileName,
272  pboth_dir_info->FileName);
273 }
GLint level
Definition: gl.h:1546
FILE * dlog_file
Definition: daemon_debug.c:37
static int g_debug_level
Definition: daemon_debug.c:33
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
unsigned long DWORD
Definition: ntddk_ex.h:95

◆ print_hexbuf()

void print_hexbuf ( int  level,
unsigned char title,
unsigned char buf,
int  len 
)

Definition at line 98 of file daemon_debug.c.

Referenced by compound_encode_send_decode(), handle_upcall(), nfs41_create_session(), nfs41_downcall(), and upcall_parse().

99 {
100  int j, k;
101  if (level > g_debug_level) return;
102  fprintf(dlog_file, "%s", title);
103  for(j = 0, k = 0; j < len; j++, k++) {
104  fprintf(dlog_file, "%02x '%c' ", buf[j], isascii(buf[j])? buf[j]:' ');
105  if (((k+1) % 10 == 0 && k > 0)) {
106  fprintf(dlog_file, "\n");
107  }
108  }
109  fprintf(dlog_file, "\n");
110 }
GLint level
Definition: gl.h:1546
GLenum GLclampf GLint GLenum GLuint GLenum GLenum GLsizei GLenum const GLvoid GLfloat GLfloat GLfloat GLfloat GLclampd GLint GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean GLboolean GLboolean GLboolean GLint GLenum GLsizei const GLvoid GLenum GLint GLenum GLint GLint GLsizei GLint GLenum GLint GLint GLint GLint GLsizei GLenum GLsizei const GLuint GLboolean GLenum GLenum GLint GLsizei GLenum GLsizei GLenum const GLvoid GLboolean const GLboolean GLenum const GLdouble const GLfloat const GLdouble const GLfloat GLenum GLint GLint GLint GLint GLint GLint j
Definition: glfuncs.h:98
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
FILE * dlog_file
Definition: daemon_debug.c:37
static int g_debug_level
Definition: daemon_debug.c:33
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
GLenum GLsizei len
Definition: glext.h:6722
#define isascii
Definition: ctype.h:742
static char title[]
Definition: ps.c:92
int k
Definition: mpi.c:3369

◆ print_hexbuf_no_asci()

void print_hexbuf_no_asci ( int  level,
unsigned char title,
unsigned char buf,
int  len 
)

Definition at line 112 of file daemon_debug.c.

Referenced by map_dacl_2_nfs4acl().

113 {
114  int j, k;
115  if (level > g_debug_level) return;
116  fprintf(dlog_file, "%s", title);
117  for(j = 0, k = 0; j < len; j++, k++) {
118  fprintf(dlog_file, "%02x ", buf[j]);
119  if (((k+1) % 10 == 0 && k > 0)) {
120  fprintf(dlog_file, "\n");
121  }
122  }
123  fprintf(dlog_file, "\n");
124 }
GLint level
Definition: gl.h:1546
GLenum GLclampf GLint GLenum GLuint GLenum GLenum GLsizei GLenum const GLvoid GLfloat GLfloat GLfloat GLfloat GLclampd GLint GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean GLboolean GLboolean GLboolean GLint GLenum GLsizei const GLvoid GLenum GLint GLenum GLint GLint GLsizei GLint GLenum GLint GLint GLint GLint GLsizei GLenum GLsizei const GLuint GLboolean GLenum GLenum GLint GLsizei GLenum GLsizei GLenum const GLvoid GLboolean const GLboolean GLenum const GLdouble const GLfloat const GLdouble const GLfloat GLenum GLint GLint GLint GLint GLint GLint j
Definition: glfuncs.h:98
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
FILE * dlog_file
Definition: daemon_debug.c:37
static int g_debug_level
Definition: daemon_debug.c:33
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
GLenum GLsizei len
Definition: glext.h:6722
static char title[]
Definition: ps.c:92
int k
Definition: mpi.c:3369

◆ print_nfs_access_mask()

void print_nfs_access_mask ( int  on,
int  m 
)

Definition at line 640 of file daemon_debug.c.

Referenced by map_acemask().

641 {
642  if (!on) return;
643  dprintf(1, "--> print_nfs_access_mask: %x\n", m);
644  if (m & ACE4_READ_DATA)
645  dprintf(1, "\tACE4_READ_DATA\n");
646  if (m & ACE4_LIST_DIRECTORY)
647  dprintf(1, "\tACE4_LIST_DIRECTORY\n");
648  if (m & ACE4_WRITE_DATA)
649  dprintf(1, "\tACE4_WRITE_DATA\n");
650  if (m & ACE4_ADD_FILE)
651  dprintf(1, "\tACE4_ADD_FILE\n");
652  if (m & ACE4_APPEND_DATA)
653  dprintf(1, "\tACE4_APPEND_DATA\n");
654  if (m & ACE4_ADD_SUBDIRECTORY)
655  dprintf(1, "\tACE4_ADD_SUBDIRECTORY\n");
656  if (m & ACE4_READ_NAMED_ATTRS)
657  dprintf(1, "\tACE4_READ_NAMED_ATTRS\n");
659  dprintf(1, "\tACE4_WRITE_NAMED_ATTRS\n");
660  if (m & ACE4_EXECUTE)
661  dprintf(1, "\tACE4_EXECUTE\n");
662  if (m & ACE4_DELETE_CHILD)
663  dprintf(1, "\tACE4_DELETE_CHILD\n");
664  if (m & ACE4_READ_ATTRIBUTES)
665  dprintf(1, "\tACE4_READ_ATTRIBUTES\n");
666  if (m & ACE4_WRITE_ATTRIBUTES)
667  dprintf(1, "\tACE4_WRITE_ATTRIBUTES\n");
668  if (m & ACE4_DELETE)
669  dprintf(1, "\tACE4_DELETE\n");
670  if (m & ACE4_READ_ACL)
671  dprintf(1, "\tACE4_READ_ACL\n");
672  if (m & ACE4_WRITE_ACL)
673  dprintf(1, "\tACE4_WRITE_ACL\n");
674  if (m & ACE4_WRITE_OWNER)
675  dprintf(1, "\tACE4_WRITE_OWNER\n");
676  if (m & ACE4_SYNCHRONIZE)
677  dprintf(1, "\tACE4_SYNCHRONIZE\n");
678 }
void dprintf(int level, LPCSTR format,...)
Definition: daemon_debug.c:72
#define ACE4_DELETE_CHILD
Definition: nfs41_const.h:333
#define ACE4_WRITE_ACL
Definition: nfs41_const.h:341
#define ACE4_READ_DATA
Definition: nfs41_const.h:324
#define ACE4_READ_ATTRIBUTES
Definition: nfs41_const.h:334
#define ACE4_ADD_FILE
Definition: nfs41_const.h:327
#define ACE4_DELETE
Definition: nfs41_const.h:339
#define ACE4_WRITE_ATTRIBUTES
Definition: nfs41_const.h:335
#define ACE4_READ_ACL
Definition: nfs41_const.h:340
#define ACE4_LIST_DIRECTORY
Definition: nfs41_const.h:325
#define ACE4_EXECUTE
Definition: nfs41_const.h:332
#define ACE4_ADD_SUBDIRECTORY
Definition: nfs41_const.h:329
const GLfloat * m
Definition: glext.h:10848
#define ACE4_READ_NAMED_ATTRS
Definition: nfs41_const.h:330
#define ACE4_WRITE_OWNER
Definition: nfs41_const.h:342
#define ACE4_SYNCHRONIZE
Definition: nfs41_const.h:343
#define ACE4_APPEND_DATA
Definition: nfs41_const.h:328
#define ACE4_WRITE_NAMED_ATTRS
Definition: nfs41_const.h:331
#define ACE4_WRITE_DATA
Definition: nfs41_const.h:326

◆ print_opcode()

void print_opcode ( int  level,
DWORD  opcode 
)

Definition at line 275 of file daemon_debug.c.

276 {
278 }
void dprintf(int level, LPCSTR format,...)
Definition: daemon_debug.c:72
GLint level
Definition: gl.h:1546
GLenum GLclampf GLint GLenum GLuint GLenum GLenum GLsizei GLenum const GLvoid GLfloat GLfloat GLfloat GLfloat GLclampd GLint GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean GLboolean GLboolean GLboolean GLint GLenum GLsizei const GLvoid GLenum GLint GLenum GLint GLint GLsizei GLint GLenum GLint GLint GLint GLint GLsizei GLenum GLsizei const GLuint GLboolean GLenum GLenum GLint GLsizei GLenum GLsizei GLenum const GLvoid GLboolean const GLboolean GLenum const GLdouble const GLfloat const GLdouble const GLfloat GLenum GLint GLint GLint GLint GLint GLint GLenum GLfloat GLenum GLint GLenum GLsizei GLenum GLboolean GLenum GLdouble GLenum GLfloat GLenum GLenum GLfloat GLenum GLenum GLdouble GLenum GLenum GLint GLenum GLenum GLint GLenum GLuint GLenum GLvoid const GLubyte GLenum GLenum GLenum GLint GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLvoid GLenum GLint GLenum GLint GLenum GLenum GLint GLuint GLdouble GLfloat GLint GLshort GLubyte GLenum GLuint GLenum const GLfloat GLenum const GLint GLenum GLenum const GLfloat GLenum GLenum const GLint GLfloat const GLfloat GLenum opcode
Definition: glfuncs.h:172
const char * LPCSTR
Definition: xmlstorage.h:183
const char * opcode2string(DWORD opcode)
Definition: daemon_debug.c:280

◆ print_share_mode()

void print_share_mode ( int  level,
DWORD  mode 
)

Definition at line 215 of file daemon_debug.c.

Referenced by parse_open().

216 {
217  if (level > g_debug_level) return;
218  fprintf(dlog_file, "share mode: ");
219  if (mode & FILE_SHARE_READ)
220  fprintf(dlog_file, "READ ");
221  if (mode & FILE_SHARE_WRITE)
222  fprintf(dlog_file, "WRITE ");
223  if (mode & FILE_SHARE_DELETE)
224  fprintf(dlog_file, "DELETE");
225  fprintf(dlog_file, "\n");
226 }
GLint level
Definition: gl.h:1546
FILE * dlog_file
Definition: daemon_debug.c:37
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
static int g_debug_level
Definition: daemon_debug.c:33
#define FILE_SHARE_READ
Definition: compat.h:125
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
#define FILE_SHARE_DELETE
Definition: nt_native.h:682

◆ print_sr_status_flags()

void print_sr_status_flags ( int  level,
int  flags 
)

Definition at line 525 of file daemon_debug.c.

Referenced by compound_encode_send_decode().

526 {
527  if (level > g_debug_level) return;
528  fprintf(dlog_file, "%04x: sr_status_flags: ", GetCurrentThreadId());
530  fprintf(dlog_file, "SEQ4_STATUS_CB_PATH_DOWN ");
532  fprintf(dlog_file, "SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRING ");
534  fprintf(dlog_file, "SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRED ");
536  fprintf(dlog_file, "SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED ");
538  fprintf(dlog_file, "SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED ");
540  fprintf(dlog_file, "SEQ4_STATUS_ADMIN_STATE_REVOKED ");
542  fprintf(dlog_file, "SEQ4_STATUS_RECALLABLE_STATE_REVOKED ");
544  fprintf(dlog_file, "SEQ4_STATUS_LEASE_MOVED ");
546  fprintf(dlog_file, "SEQ4_STATUS_RESTART_RECLAIM_NEEDED ");
548  fprintf(dlog_file, "SEQ4_STATUS_CB_PATH_DOWN_SESSION ");
550  fprintf(dlog_file, "SEQ4_STATUS_BACKCHANNEL_FAULT ");
552  fprintf(dlog_file, "SEQ4_STATUS_DEVID_CHANGED ");
554  fprintf(dlog_file, "SEQ4_STATUS_DEVID_DELETED ");
555  fprintf(dlog_file, "\n");
556 }
GLint level
Definition: gl.h:1546
FILE * dlog_file
Definition: daemon_debug.c:37
static int g_debug_level
Definition: daemon_debug.c:33
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:421
GLbitfield flags
Definition: glext.h:7161

◆ print_windows_access_mask()

void print_windows_access_mask ( int  on,
ACCESS_MASK  m 
)

Definition at line 570 of file daemon_debug.c.

Referenced by map_acemask().

571 {
572  if (!on) return;
573  dprintf(1, "--> print_windows_access_mask: %x\n", m);
574  if (m & GENERIC_READ)
575  dprintf(1, "\tGENERIC_READ\n");
576  if (m & GENERIC_WRITE)
577  dprintf(1, "\tGENERIC_WRITE\n");
578  if (m & GENERIC_EXECUTE)
579  dprintf(1, "\tGENERIC_EXECUTE\n");
580  if (m & GENERIC_ALL)
581  dprintf(1, "\tGENERIC_ALL\n");
582  if (m & MAXIMUM_ALLOWED)
583  dprintf(1, "\tMAXIMUM_ALLOWED\n");
585  dprintf(1, "\tACCESS_SYSTEM_SECURITY\n");
586  if ((m & SPECIFIC_RIGHTS_ALL) == SPECIFIC_RIGHTS_ALL)
587  dprintf(1, "\tSPECIFIC_RIGHTS_ALL\n");
588  if ((m & STANDARD_RIGHTS_ALL) == STANDARD_RIGHTS_ALL)
589  dprintf(1, "\tSTANDARD_RIGHTS_ALL\n");
590  if ((m & STANDARD_RIGHTS_REQUIRED) == STANDARD_RIGHTS_REQUIRED)
591  dprintf(1, "\tSTANDARD_RIGHTS_REQUIRED\n");
592  if (m & SYNCHRONIZE)
593  dprintf(1, "\tSYNCHRONIZE\n");
594  if (m & WRITE_OWNER)
595  dprintf(1, "\tWRITE_OWNER\n");
596  if (m & WRITE_DAC)
597  dprintf(1, "\tWRITE_DAC\n");
598  if (m & READ_CONTROL)
599  dprintf(1, "\tREAD_CONTROL\n");
600  if (m & DELETE)
601  dprintf(1, "\tDELETE\n");
602  if (m & FILE_READ_DATA)
603  dprintf(1, "\tFILE_READ_DATA\n");
604  if (m & FILE_LIST_DIRECTORY)
605  dprintf(1, "\tFILE_LIST_DIRECTORY\n");
606  if (m & FILE_WRITE_DATA)
607  dprintf(1, "\tFILE_WRITE_DATA\n");
608  if (m & FILE_ADD_FILE)
609  dprintf(1, "\tFILE_ADD_FILE\n");
610  if (m & FILE_APPEND_DATA)
611  dprintf(1, "\tFILE_APPEND_DATA\n");
612  if (m & FILE_ADD_SUBDIRECTORY)
613  dprintf(1, "\tFILE_ADD_SUBDIRECTORY\n");
615  dprintf(1, "\tFILE_CREATE_PIPE_INSTANCE\n");
616  if (m & FILE_READ_EA)
617  dprintf(1, "\tFILE_READ_EA\n");
618  if (m & FILE_WRITE_EA)
619  dprintf(1, "\tFILE_WRITE_EA\n");
620  if (m & FILE_EXECUTE)
621  dprintf(1, "\tFILE_EXECUTE\n");
622  if (m & FILE_TRAVERSE)
623  dprintf(1, "\tFILE_TRAVERSE\n");
624  if (m & FILE_DELETE_CHILD)
625  dprintf(1, "\tFILE_DELETE_CHILD\n");
626  if (m & FILE_READ_ATTRIBUTES)
627  dprintf(1, "\tFILE_READ_ATTRIBUTES\n");
628  if (m & FILE_WRITE_ATTRIBUTES)
629  dprintf(1, "\tFILE_WRITE_ATTRIBUTES\n");
630  if ((m & FILE_ALL_ACCESS) == FILE_ALL_ACCESS)
631  dprintf(1, "\tFILE_ALL_ACCESS\n");
632  if ((m & FILE_GENERIC_READ) == FILE_GENERIC_READ)
633  dprintf(1, "\tFILE_GENERIC_READ\n");
634  if ((m & FILE_GENERIC_WRITE) == FILE_GENERIC_WRITE)
635  dprintf(1, "\tFILE_GENERIC_WRITE\n");
636  if ((m & FILE_GENERIC_EXECUTE) == FILE_GENERIC_EXECUTE)
637  dprintf(1, "\tFILE_GENERIC_EXECUTE\n");
638 }
#define FILE_GENERIC_READ
Definition: nt_native.h:653
void dprintf(int level, LPCSTR format,...)
Definition: daemon_debug.c:72
#define MAXIMUM_ALLOWED
Definition: nt_native.h:83
#define FILE_WRITE_EA
Definition: nt_native.h:640
#define GENERIC_ALL
Definition: nt_native.h:92
#define FILE_ALL_ACCESS
Definition: nt_native.h:651
#define ACCESS_SYSTEM_SECURITY
Definition: nt_native.h:77
#define FILE_CREATE_PIPE_INSTANCE
Definition: nt_native.h:636
#define WRITE_OWNER
Definition: nt_native.h:60
#define FILE_APPEND_DATA
Definition: nt_native.h:634
#define FILE_WRITE_ATTRIBUTES
Definition: nt_native.h:649
#define FILE_TRAVERSE
Definition: nt_native.h:643
#define FILE_DELETE_CHILD
Definition: nt_native.h:645
#define FILE_ADD_FILE
Definition: nt_native.h:632
#define FILE_READ_DATA
Definition: nt_native.h:628
#define GENERIC_WRITE
Definition: nt_native.h:90
#define FILE_WRITE_DATA
Definition: nt_native.h:631
#define FILE_GENERIC_EXECUTE
Definition: nt_native.h:668
#define FILE_LIST_DIRECTORY
Definition: nt_native.h:629
#define WRITE_DAC
Definition: nt_native.h:59
#define SPECIFIC_RIGHTS_ALL
Definition: nt_native.h:71
#define READ_CONTROL
Definition: nt_native.h:58
#define FILE_READ_ATTRIBUTES
Definition: nt_native.h:647
#define FILE_ADD_SUBDIRECTORY
Definition: nt_native.h:635
#define FILE_EXECUTE
Definition: nt_native.h:642
#define GENERIC_READ
Definition: compat.h:124
#define SYNCHRONIZE
Definition: nt_native.h:61
#define FILE_GENERIC_WRITE
Definition: nt_native.h:660
const GLfloat * m
Definition: glext.h:10848
#define STANDARD_RIGHTS_ALL
Definition: nt_native.h:69
#define FILE_READ_EA
Definition: nt_native.h:638
#define STANDARD_RIGHTS_REQUIRED
Definition: nt_native.h:63
#define GENERIC_EXECUTE
Definition: nt_native.h:91
#define DELETE
Definition: nt_native.h:57

◆ rpc_error_string()

const char* rpc_error_string ( int  status)

Definition at line 482 of file daemon_debug.c.

Referenced by nfs41_send_compound().

483 {
484  switch (status)
485  {
486  case RPC_CANTENCODEARGS: return "RPC_CANTENCODEARGS";
487  case RPC_CANTDECODERES: return "RPC_CANTDECODERES";
488  case RPC_CANTSEND: return "RPC_CANTSEND";
489  case RPC_CANTRECV: return "RPC_CANTRECV";
490  case RPC_TIMEDOUT: return "RPC_TIMEDOUT";
491  case RPC_INTR: return "RPC_INTR";
492  case RPC_UDERROR: return "RPC_UDERROR";
493  case RPC_VERSMISMATCH: return "RPC_VERSMISMATCH";
494  case RPC_AUTHERROR: return "RPC_AUTHERROR";
495  case RPC_PROGUNAVAIL: return "RPC_PROGUNAVAIL";
496  case RPC_PROGVERSMISMATCH: return "RPC_PROGVERSMISMATCH";
497  case RPC_PROCUNAVAIL: return "RPC_PROCUNAVAIL";
498  case RPC_CANTDECODEARGS: return "RPC_CANTDECODEARGS";
499  case RPC_SYSTEMERROR: return "RPC_SYSTEMERROR";
500  default: return "invalid rpc error code";
501  }
502 }
Definition: ps.c:97

◆ secflavorop2name()

const char* secflavorop2name ( DWORD  sec_flavor)

Definition at line 558 of file daemon_debug.c.

Referenced by create_rpcsec_auth_client(), nfs41_rpc_clnt_create(), and parse_mount().

559 {
560  switch(sec_flavor) {
561  case RPCSEC_AUTH_SYS: return "AUTH_SYS";
562  case RPCSEC_AUTHGSS_KRB5: return "AUTHGSS_KRB5";
563  case RPCSEC_AUTHGSS_KRB5I: return "AUTHGSS_KRB5I";
564  case RPCSEC_AUTHGSS_KRB5P: return "AUTHGSS_KRB5P";
565  }
566 
567  return "UNKNOWN FLAVOR";
568 }
sec_flavor
Definition: nfs41_ops.h:861

◆ set_debug_level()

void set_debug_level ( int  level)

Definition at line 35 of file daemon_debug.c.

Referenced by ServiceStart().

35 { g_debug_level = level; }
GLint level
Definition: gl.h:1546
static int g_debug_level
Definition: daemon_debug.c:33

Variable Documentation

◆ dlog_file

FILE* dlog_file

Definition at line 37 of file daemon_debug.c.

◆ elog_file

FILE * elog_file

Definition at line 37 of file daemon_debug.c.

◆ g_debug_level