home *** CD-ROM | disk | FTP | other *** search
/ Serving the Web / ServingTheWeb1995.disc1of1.iso / linux / slacksrce / contrib / samba / samba-1.8 / samba-1 / samba-1.8.05 / trans2.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-27  |  7.6 KB  |  212 lines

  1. /* 
  2.    Unix SMB/Netbios implementation.
  3.    Version 1.8.
  4.    Copyright (C) Jeremy Allison 1994
  5.  
  6.    This program is free software; you can redistribute it and/or modify
  7.    it under the terms of the GNU General Public License as published by
  8.    the Free Software Foundation; either version 2 of the License, or
  9.    (at your option) any later version.
  10.    
  11.    This program is distributed in the hope that it will be useful,
  12.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.    GNU General Public License for more details.
  15.    
  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., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. */
  20.  
  21. #ifndef _TRANS2_H_
  22. #define _TRANS2_H_
  23.  
  24. /* Define the structures needed for the trans2 calls. */
  25.  
  26. /*******************************************************
  27.  For DosFindFirst/DosFindNext - level 1
  28.  
  29. MAXFILENAMELEN = 255;
  30. FDATE == uint16
  31. FTIME == uint16
  32. ULONG == uint32
  33. USHORT == uint16
  34.  
  35. typedef struct _FILEFINDBUF {
  36. Byte offset   Type     name                description
  37. -------------+-------+-------------------+--------------
  38. 0             FDATE    fdateCreation;
  39. 2             FTIME    ftimeCreation;
  40. 4             FDATE    fdateLastAccess;
  41. 6             FTIME    ftimeLastAccess;
  42. 8             FDATE    fdateLastWrite;
  43. 10            FTIME    ftimeLastWrite;
  44. 12            ULONG    cbFile               file length in bytes
  45. 16            ULONG    cbFileAlloc          size of file allocation unit
  46. 20            USHORT   attrFile
  47. 22            UCHAR    cchName              length of name to follow (not including zero)
  48. 23            UCHAR    achName[MAXFILENAMELEN]; Null terminated name
  49. } FILEFINDBUF;
  50. *********************************************************/
  51.  
  52. #define l1_fdateCreation 0
  53. #define l1_fdateLastAccess 4
  54. #define l1_fdateLastWrite 8
  55. #define l1_cbFile 12
  56. #define l1_cbFileAlloc 16
  57. #define l1_attrFile 20
  58. #define l1_cchName 22
  59. #define l1_achName 23
  60.  
  61. /**********************************************************
  62. For DosFindFirst/DosFindNext - level 2
  63.  
  64. typedef struct _FILEFINDBUF2 {
  65. Byte offset   Type     name                description
  66. -------------+-------+-------------------+--------------
  67. 0             FDATE    fdateCreation;
  68. 2             FTIME    ftimeCreation;
  69. 4             FDATE    fdateLastAccess;
  70. 6             FTIME    ftimeLastAccess;
  71. 8             FDATE    fdateLastWrite;
  72. 10            FTIME    ftimeLastWrite;
  73. 12            ULONG    cbFile               file length in bytes
  74. 16            ULONG    cbFileAlloc          size of file allocation unit
  75. 20            USHORT   attrFile
  76. 22            ULONG    cbList               Extended attribute list (always 0)
  77. 26            UCHAR    cchName              length of name to follow (not including zero)
  78. 27            UCHAR    achName[MAXFILENAMELEN]; Null terminated name
  79. } FILEFINDBUF2;
  80. *************************************************************/
  81.  
  82. #define l2_fdateCreation 0
  83. #define l2_fdateLastAccess 4
  84. #define l2_fdateLastWrite 8
  85. #define l2_cbFile 12
  86. #define l2_cbFileAlloc 16
  87. #define l2_attrFile 20
  88. #define l2_cbList 22
  89. #define l2_cchName 26
  90. #define l2_achName 27
  91.  
  92. /**********************************************************
  93. For DosQueryPathInfo/DosQueryFileInfo/DosSetPathInfo/
  94. DosSetFileInfo - level 1
  95.  
  96. typedef struct _FILESTATUS {
  97. Byte offset   Type     name                description
  98. -------------+-------+-------------------+--------------
  99. 0             FDATE    fdateCreation;
  100. 2             FTIME    ftimeCreation;
  101. 4             FDATE    fdateLastAccess;
  102. 6             FTIME    ftimeLastAccess;
  103. 8             FDATE    fdateLastWrite;
  104. 10            FTIME    ftimeLastWrite;
  105. 12            ULONG    cbFile               file length in bytes
  106. 16            ULONG    cbFileAlloc          size of file allocation unit
  107. 20            USHORT   attrFile
  108. } FILESTATUS;
  109. *************************************************************/
  110.  
  111. /* Use the l1_ defines from DosFindFirst */
  112.  
  113. /**********************************************************
  114. For DosQueryPathInfo/DosQueryFileInfo/DosSetPathInfo/
  115. DosSetFileInfo - level 2
  116.  
  117. typedef struct _FILESTATUS2 {
  118. Byte offset   Type     name                description
  119. -------------+-------+-------------------+--------------
  120. 0             FDATE    fdateCreation;
  121. 2             FTIME    ftimeCreation;
  122. 4             FDATE    fdateLastAccess;
  123. 6             FTIME    ftimeLastAccess;
  124. 8             FDATE    fdateLastWrite;
  125. 10            FTIME    ftimeLastWrite;
  126. 12            ULONG    cbFile               file length in bytes
  127. 16            ULONG    cbFileAlloc          size of file allocation unit
  128. 20            USHORT   attrFile
  129. 22            ULONG    cbList               Length of EA's (0)
  130. } FILESTATUS2;
  131. *************************************************************/
  132.  
  133. /* Use the l2_ #defines from DosFindFirst */
  134.  
  135. /**********************************************************
  136. For DosQFSInfo/DosSetFSInfo - level 1
  137.  
  138. typedef struct _FSALLOCATE {
  139. Byte offset   Type     name                description
  140. -------------+-------+-------------------+--------------
  141. 0             ULONG    idFileSystem       id of file system
  142. 4             ULONG    cSectorUnit        number of sectors per allocation unit
  143. 8             ULONG    cUnit              number of allocation units
  144. 12            ULONG    cUnitAvail         Available allocation units
  145. 16            USHORT   cbSector           bytes per sector
  146. } FSALLOCATE;
  147. *************************************************************/
  148.  
  149. #define l1_idFileSystem 0
  150. #define l1_cSectorUnit 4
  151. #define l1_cUnit 8
  152. #define l1_cUnitAvail 12
  153. #define l1_cbSector 16
  154.  
  155. /**********************************************************
  156. For DosQFSInfo/DosSetFSInfo - level 2
  157.  
  158. typedef struct _FSINFO {
  159. Byte offset   Type     name                description
  160. -------------+-------+-------------------+--------------
  161. 0             FDATE   vol_fdateCreation
  162. 2             FTIME   vol_ftimeCreation
  163. 4             UCHAR   vol_cch             length of volume name (excluding NULL)
  164. 5             UCHAR   vol_szVolLabel[12]  volume name
  165. } FSINFO;
  166. *************************************************************/
  167.  
  168. #define l2_vol_fdateCreation 0
  169. #define l2_vol_cch 4
  170. #define l2_vol_szVolLabel 5
  171.  
  172. /* Function prototypes */
  173.  
  174. int lanman2_match( char *, char *, int);
  175.  
  176. int call_trans2open(char *inbuf, char *outbuf, int bufsize, int cnum, 
  177.             char **pparams, char **ppdata);
  178.  
  179. int call_trans2findfirst(char *inbuf, char *outbuf, int bufsize, int cnum, 
  180.              char **pparams, char **ppdata);
  181.  
  182. int call_trans2setfsinfo(char *inbuf, char *outbuf, int length, int bufsize,
  183.             int cnum, char **pparams, char **pdata);
  184.  
  185. int call_trans2qpathinfo(char *inbuf, char *outbuf, int length, int bufsize,
  186.             int cnum, char **pparams, char **pdata);
  187.  
  188. int call_trans2setpathinfo(char *inbuf, char *outbuf, int length, int bufsize,
  189.             int cnum, char **pparams, char **pdata);
  190.  
  191. int call_trans2qfileinfo(char *inbuf, char *outbuf, int length, int bufsize,
  192.             int cnum, char **pparams, char **pdata);
  193.  
  194. int call_trans2setfileinfo(char *inbuf, char *outbuf, int length, int bufsize,
  195.             int cnum, char **pparams, char **pdata);
  196.  
  197. int call_trans2mkdir(char *inbuf, char *outbuf, int length, int bufsize,
  198.             int cnum, char **pparams, char **pdata);
  199.  
  200. int call_trans2findnotifyfirst(char *inbuf, char *outbuf, int length, int bufsize,
  201.             int cnum, char **pparams, char **pdata);
  202.  
  203. int call_trans2findnotifynext(char *inbuf, char *outbuf, int length, int bufsize,
  204.             int cnum, char **pparams, char **pdata);
  205.  
  206. int reply_findnclose(char *inbuf,char *outbuf,int length,int bufsize);
  207.  
  208. int reply_findclose(char *inbuf,char *outbuf,int length,int bufsize);
  209.  
  210. #endif
  211.  
  212.