Print this page
NEX-1643 dtrace provider for smbsrv
Also illumos 1841:
 DTrace smb provider was mis-implemented, doesn't exist.
Add back handlers for read/write raw, so that
 legacy dtrace consumers can find the probes.
Kill extra arg in smb_negotiate
Fix missing "done" probe with smb_notify
Add example consumer: smb-trace.d
fix soi_pid


  92         smb_dtrace1(__func__, #n, #a, (long)b)
  93 
  94 #undef  DTRACE_PROBE2
  95 #define DTRACE_PROBE2(n, a, b, c, d) \
  96         smb_dtrace2(__func__, #n, #a, (long)b, #c, (long)d)
  97 
  98 #undef  DTRACE_PROBE3
  99 #define DTRACE_PROBE3(n, a, b, c, d, e, f) \
 100         smb_dtrace3(__func__, #n, #a, (long)b, #c, (long)d, #e, (long)f)
 101 
 102 #endif  /* _KERNEL */
 103 
 104 extern  int smb_maxbufsize;
 105 extern  int smb_flush_required;
 106 extern  int smb_dirsymlink_enable;
 107 extern  int smb_oplock_levelII;
 108 extern  int smb_oplock_timeout;
 109 extern  int smb_oplock_min_timeout;
 110 extern  int smb_shortnames;
 111 extern  int smb_sign_debug;
 112 extern  int smb_raw_mode;
 113 extern  uint_t smb_audit_flags;
 114 extern  int smb_ssetup_threshold;
 115 extern  int smb_tcon_threshold;
 116 extern  int smb_opipe_threshold;
 117 extern  int smb_ssetup_timeout;
 118 extern  int smb_tcon_timeout;
 119 extern  int smb_opipe_timeout;
 120 extern const uint32_t smb_vop_dosattr_settable;
 121 
 122 /* Thread priorities - see smb_init.c */
 123 extern  int smbsrv_base_pri;
 124 extern  int smbsrv_listen_pri;
 125 extern  int smbsrv_receive_pri;
 126 extern  int smbsrv_worker_pri;
 127 extern  int smbsrv_notify_pri;
 128 extern  int smbsrv_timer_pri;
 129 
 130 extern  kmem_cache_t            *smb_cache_request;
 131 extern  kmem_cache_t            *smb_cache_session;
 132 extern  kmem_cache_t            *smb_cache_user;


 790 boolean_t smb_tree_is_connected(smb_tree_t *);
 791 boolean_t smb_tree_is_connected_locked(smb_tree_t *);
 792 #define SMB_TREE_GET_TID(tree)          ((tree)->t_tid)
 793 
 794 smb_xa_t *smb_xa_create(smb_session_t *session, smb_request_t *sr,
 795     uint32_t total_parameter_count, uint32_t total_data_count,
 796     uint32_t max_parameter_count, uint32_t max_data_count,
 797     uint32_t max_setup_count, uint32_t setup_word_count);
 798 void smb_xa_delete(smb_xa_t *xa);
 799 smb_xa_t *smb_xa_hold(smb_xa_t *xa);
 800 void smb_xa_rele(smb_session_t *session, smb_xa_t *xa);
 801 int smb_xa_open(smb_xa_t *xa);
 802 void smb_xa_close(smb_xa_t *xa);
 803 int smb_xa_complete(smb_xa_t *xa);
 804 smb_xa_t *smb_xa_find(smb_session_t *session, uint32_t pid, uint16_t mid);
 805 
 806 struct mbuf *smb_mbuf_get(uchar_t *buf, int nbytes);
 807 struct mbuf *smb_mbuf_allocate(struct uio *uio);
 808 void smb_mbuf_trim(struct mbuf *mhead, int nbytes);
 809 
 810 void smb_check_status(void);
 811 int smb_handle_write_raw(smb_session_t *session, smb_request_t *sr);
 812 
 813 int32_t smb_time_gmt_to_local(smb_request_t *, int32_t);
 814 int32_t smb_time_local_to_gmt(smb_request_t *, int32_t);
 815 int32_t smb_time_dos_to_unix(int16_t, int16_t);
 816 void smb_time_unix_to_dos(int32_t, int16_t *, int16_t *);
 817 void smb_time_nt_to_unix(uint64_t nt_time, timestruc_t *unix_time);
 818 uint64_t smb_time_unix_to_nt(timestruc_t *);
 819 
 820 int netbios_name_isvalid(char *in, char *out);
 821 
 822 int uioxfer(struct uio *src_uio, struct uio *dst_uio, int n);
 823 
 824 /*
 825  * Pool ID function prototypes
 826  */
 827 int     smb_idpool_constructor(smb_idpool_t *pool);
 828 void    smb_idpool_destructor(smb_idpool_t  *pool);
 829 int     smb_idpool_alloc(smb_idpool_t *pool, uint16_t *id);
 830 void    smb_idpool_free(smb_idpool_t *pool, uint16_t id);
 831 
 832 /*




  92         smb_dtrace1(__func__, #n, #a, (long)b)
  93 
  94 #undef  DTRACE_PROBE2
  95 #define DTRACE_PROBE2(n, a, b, c, d) \
  96         smb_dtrace2(__func__, #n, #a, (long)b, #c, (long)d)
  97 
  98 #undef  DTRACE_PROBE3
  99 #define DTRACE_PROBE3(n, a, b, c, d, e, f) \
 100         smb_dtrace3(__func__, #n, #a, (long)b, #c, (long)d, #e, (long)f)
 101 
 102 #endif  /* _KERNEL */
 103 
 104 extern  int smb_maxbufsize;
 105 extern  int smb_flush_required;
 106 extern  int smb_dirsymlink_enable;
 107 extern  int smb_oplock_levelII;
 108 extern  int smb_oplock_timeout;
 109 extern  int smb_oplock_min_timeout;
 110 extern  int smb_shortnames;
 111 extern  int smb_sign_debug;

 112 extern  uint_t smb_audit_flags;
 113 extern  int smb_ssetup_threshold;
 114 extern  int smb_tcon_threshold;
 115 extern  int smb_opipe_threshold;
 116 extern  int smb_ssetup_timeout;
 117 extern  int smb_tcon_timeout;
 118 extern  int smb_opipe_timeout;
 119 extern const uint32_t smb_vop_dosattr_settable;
 120 
 121 /* Thread priorities - see smb_init.c */
 122 extern  int smbsrv_base_pri;
 123 extern  int smbsrv_listen_pri;
 124 extern  int smbsrv_receive_pri;
 125 extern  int smbsrv_worker_pri;
 126 extern  int smbsrv_notify_pri;
 127 extern  int smbsrv_timer_pri;
 128 
 129 extern  kmem_cache_t            *smb_cache_request;
 130 extern  kmem_cache_t            *smb_cache_session;
 131 extern  kmem_cache_t            *smb_cache_user;


 789 boolean_t smb_tree_is_connected(smb_tree_t *);
 790 boolean_t smb_tree_is_connected_locked(smb_tree_t *);
 791 #define SMB_TREE_GET_TID(tree)          ((tree)->t_tid)
 792 
 793 smb_xa_t *smb_xa_create(smb_session_t *session, smb_request_t *sr,
 794     uint32_t total_parameter_count, uint32_t total_data_count,
 795     uint32_t max_parameter_count, uint32_t max_data_count,
 796     uint32_t max_setup_count, uint32_t setup_word_count);
 797 void smb_xa_delete(smb_xa_t *xa);
 798 smb_xa_t *smb_xa_hold(smb_xa_t *xa);
 799 void smb_xa_rele(smb_session_t *session, smb_xa_t *xa);
 800 int smb_xa_open(smb_xa_t *xa);
 801 void smb_xa_close(smb_xa_t *xa);
 802 int smb_xa_complete(smb_xa_t *xa);
 803 smb_xa_t *smb_xa_find(smb_session_t *session, uint32_t pid, uint16_t mid);
 804 
 805 struct mbuf *smb_mbuf_get(uchar_t *buf, int nbytes);
 806 struct mbuf *smb_mbuf_allocate(struct uio *uio);
 807 void smb_mbuf_trim(struct mbuf *mhead, int nbytes);
 808 



 809 int32_t smb_time_gmt_to_local(smb_request_t *, int32_t);
 810 int32_t smb_time_local_to_gmt(smb_request_t *, int32_t);
 811 int32_t smb_time_dos_to_unix(int16_t, int16_t);
 812 void smb_time_unix_to_dos(int32_t, int16_t *, int16_t *);
 813 void smb_time_nt_to_unix(uint64_t nt_time, timestruc_t *unix_time);
 814 uint64_t smb_time_unix_to_nt(timestruc_t *);
 815 
 816 int netbios_name_isvalid(char *in, char *out);
 817 
 818 int uioxfer(struct uio *src_uio, struct uio *dst_uio, int n);
 819 
 820 /*
 821  * Pool ID function prototypes
 822  */
 823 int     smb_idpool_constructor(smb_idpool_t *pool);
 824 void    smb_idpool_destructor(smb_idpool_t  *pool);
 825 int     smb_idpool_alloc(smb_idpool_t *pool, uint16_t *id);
 826 void    smb_idpool_free(smb_idpool_t *pool, uint16_t id);
 827 
 828 /*