client.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /*
  2. Unix SMB/Netbios implementation.
  3. Version 1.9.
  4. SMB parameters and setup
  5. Copyright (C) Andrew Tridgell 1992-1998
  6. Copyright (C) Luke Kenneth Casson Leighton 1996-1998
  7. Copyright (C) Jeremy Allison 1998
  8. This program is free software; you can redistribute it and/or modify
  9. it under the terms of the GNU General Public License as published by
  10. the Free Software Foundation; either version 2 of the License, or
  11. (at your option) any later version.
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. GNU General Public License for more details.
  16. You should have received a copy of the GNU General Public License
  17. along with this program; if not, write to the Free Software
  18. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  19. */
  20. #ifndef _CLIENT_H
  21. #define _CLIENT_H
  22. /* the client asks for a smaller buffer to save ram and also to get more
  23. overlap on the wire. This size gives us a nice read/write size, which
  24. will be a multiple of the page size on almost any system */
  25. #define CLI_BUFFER_SIZE (0xFFFF)
  26. /*
  27. * These definitions depend on smb.h
  28. */
  29. typedef struct file_info
  30. {
  31. SMB_OFF_T size;
  32. uint16 mode;
  33. uid_t uid;
  34. gid_t gid;
  35. /* these times are normally kept in GMT */
  36. time_t mtime;
  37. time_t atime;
  38. time_t ctime;
  39. pstring name;
  40. } file_info;
  41. struct print_job_info
  42. {
  43. uint16 id;
  44. uint16 priority;
  45. size_t size;
  46. fstring user;
  47. fstring name;
  48. time_t t;
  49. };
  50. struct pwd_info
  51. {
  52. BOOL null_pwd;
  53. BOOL cleartext;
  54. BOOL crypted;
  55. fstring password;
  56. uchar smb_lm_pwd[16];
  57. uchar smb_nt_pwd[16];
  58. uchar smb_lm_owf[24];
  59. uchar smb_nt_owf[24];
  60. };
  61. struct cli_state {
  62. int port;
  63. int fd;
  64. uint16 cnum;
  65. uint16 pid;
  66. uint16 mid;
  67. uint16 vuid;
  68. int protocol;
  69. int sec_mode;
  70. int rap_error;
  71. int privileges;
  72. fstring eff_name;
  73. fstring desthost;
  74. fstring user_name;
  75. fstring domain;
  76. /*
  77. * The following strings are the
  78. * ones returned by the server if
  79. * the protocol > NT1.
  80. */
  81. fstring server_type;
  82. fstring server_os;
  83. fstring server_domain;
  84. fstring share;
  85. fstring dev;
  86. struct nmb_name called;
  87. struct nmb_name calling;
  88. fstring full_dest_host_name;
  89. struct in_addr dest_ip;
  90. struct pwd_info pwd;
  91. unsigned char cryptkey[8];
  92. uint32 sesskey;
  93. int serverzone;
  94. uint32 servertime;
  95. int readbraw_supported;
  96. int writebraw_supported;
  97. int timeout; /* in milliseconds. */
  98. int max_xmit;
  99. int max_mux;
  100. char *outbuf;
  101. char *inbuf;
  102. int bufsize;
  103. int initialised;
  104. int win95;
  105. uint32 capabilities;
  106. /*
  107. * Only used in NT domain calls.
  108. */
  109. uint32 nt_error; /* NT RPC error code. */
  110. uint16 nt_pipe_fnum; /* Pipe handle. */
  111. unsigned char sess_key[16]; /* Current session key. */
  112. unsigned char ntlmssp_hash[258]; /* ntlmssp data. */
  113. uint32 ntlmssp_cli_flgs; /* ntlmssp client flags */
  114. uint32 ntlmssp_srv_flgs; /* ntlmssp server flags */
  115. uint32 ntlmssp_seq_num; /* ntlmssp sequence number */
  116. DOM_CRED clnt_cred; /* Client credential. */
  117. fstring mach_acct; /* MYNAME$. */
  118. fstring srv_name_slash; /* \\remote server. */
  119. fstring clnt_name_slash; /* \\local client. */
  120. uint16 max_xmit_frag;
  121. uint16 max_recv_frag;
  122. };
  123. #endif /* _CLIENT_H */