rpc_srvsvc.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  1. /*
  2. Unix SMB/Netbios implementation.
  3. Version 1.9.
  4. SMB parameters and setup
  5. Copyright (C) Andrew Tridgell 1992-1997
  6. Copyright (C) Luke Kenneth Casson Leighton 1996-1997
  7. Copyright (C) Paul Ashton 1997
  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., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. */
  20. #ifndef _RPC_SRVSVC_H /* _RPC_SRVSVC_H */
  21. #define _RPC_SRVSVC_H
  22. /* srvsvc pipe */
  23. #define SRV_NETCONNENUM 0x08
  24. #define SRV_NETFILEENUM 0x09
  25. #define SRV_NETSESSENUM 0x0c
  26. #define SRV_NETSHAREENUM 0x0f
  27. #define SRV_NET_SRV_GET_INFO 0x15
  28. #define SRV_NET_SRV_SET_INFO 0x16
  29. #define SRV_NET_REMOTE_TOD 0x1c
  30. /* SESS_INFO_0 (pointers to level 0 session info strings) */
  31. typedef struct ptr_sess_info0
  32. {
  33. uint32 ptr_name; /* pointer to name. */
  34. } SESS_INFO_0;
  35. /* SESS_INFO_0_STR (level 0 session info strings) */
  36. typedef struct str_sess_info0
  37. {
  38. UNISTR2 uni_name; /* unicode string of name */
  39. } SESS_INFO_0_STR;
  40. /* oops - this is going to take up a *massive* amount of stack. */
  41. /* the UNISTR2s already have 1024 uint16 chars in them... */
  42. #define MAX_SESS_ENTRIES 32
  43. /* SRV_SESS_INFO_0 */
  44. typedef struct srv_sess_info_0_info
  45. {
  46. uint32 num_entries_read; /* EntriesRead */
  47. uint32 ptr_sess_info; /* Buffer */
  48. uint32 num_entries_read2; /* EntriesRead */
  49. SESS_INFO_0 info_0 [MAX_SESS_ENTRIES]; /* session entry pointers */
  50. SESS_INFO_0_STR info_0_str[MAX_SESS_ENTRIES]; /* session entry strings */
  51. } SRV_SESS_INFO_0;
  52. /* SESS_INFO_1 (pointers to level 1 session info strings) */
  53. typedef struct ptr_sess_info1
  54. {
  55. uint32 ptr_name; /* pointer to name. */
  56. uint32 ptr_user; /* pointer to user name. */
  57. uint32 num_opens;
  58. uint32 open_time;
  59. uint32 idle_time;
  60. uint32 user_flags;
  61. } SESS_INFO_1;
  62. /* SESS_INFO_1_STR (level 1 session info strings) */
  63. typedef struct str_sess_info1
  64. {
  65. UNISTR2 uni_name; /* unicode string of name */
  66. UNISTR2 uni_user; /* unicode string of user */
  67. } SESS_INFO_1_STR;
  68. /* SRV_SESS_INFO_1 */
  69. typedef struct srv_sess_info_1_info
  70. {
  71. uint32 num_entries_read; /* EntriesRead */
  72. uint32 ptr_sess_info; /* Buffer */
  73. uint32 num_entries_read2; /* EntriesRead */
  74. SESS_INFO_1 info_1 [MAX_SESS_ENTRIES]; /* session entry pointers */
  75. SESS_INFO_1_STR info_1_str[MAX_SESS_ENTRIES]; /* session entry strings */
  76. } SRV_SESS_INFO_1;
  77. /* SRV_SESS_INFO_CTR */
  78. typedef struct srv_sess_info_ctr_info
  79. {
  80. uint32 switch_value; /* switch value */
  81. uint32 ptr_sess_ctr; /* pointer to sess info union */
  82. union
  83. {
  84. SRV_SESS_INFO_0 info0; /* session info level 0 */
  85. SRV_SESS_INFO_1 info1; /* session info level 1 */
  86. } sess;
  87. } SRV_SESS_INFO_CTR;
  88. /* SRV_Q_NET_SESS_ENUM */
  89. typedef struct q_net_sess_enum_info
  90. {
  91. uint32 ptr_srv_name; /* pointer (to server name?) */
  92. UNISTR2 uni_srv_name; /* server name */
  93. uint32 ptr_qual_name; /* pointer (to qualifier name) */
  94. UNISTR2 uni_qual_name; /* qualifier name "\\qualifier" */
  95. uint32 sess_level; /* session level */
  96. SRV_SESS_INFO_CTR *ctr;
  97. uint32 preferred_len; /* preferred maximum length (0xffff ffff) */
  98. ENUM_HND enum_hnd;
  99. } SRV_Q_NET_SESS_ENUM;
  100. /* SRV_R_NET_SESS_ENUM */
  101. typedef struct r_net_sess_enum_info
  102. {
  103. uint32 sess_level; /* share level */
  104. SRV_SESS_INFO_CTR *ctr;
  105. uint32 total_entries; /* total number of entries */
  106. ENUM_HND enum_hnd;
  107. uint32 status; /* return status */
  108. } SRV_R_NET_SESS_ENUM;
  109. /* CONN_INFO_0 (pointers to level 0 connection info strings) */
  110. typedef struct ptr_conn_info0
  111. {
  112. uint32 id; /* connection id. */
  113. } CONN_INFO_0;
  114. /* oops - this is going to take up a *massive* amount of stack. */
  115. /* the UNISTR2s already have 1024 uint16 chars in them... */
  116. #define MAX_CONN_ENTRIES 32
  117. /* SRV_CONN_INFO_0 */
  118. typedef struct srv_conn_info_0_info
  119. {
  120. uint32 num_entries_read; /* EntriesRead */
  121. uint32 ptr_conn_info; /* Buffer */
  122. uint32 num_entries_read2; /* EntriesRead */
  123. CONN_INFO_0 info_0 [MAX_CONN_ENTRIES]; /* connection entry pointers */
  124. } SRV_CONN_INFO_0;
  125. /* CONN_INFO_1 (pointers to level 1 connection info strings) */
  126. typedef struct ptr_conn_info1
  127. {
  128. uint32 id; /* connection id */
  129. uint32 type; /* 0x3 */
  130. uint32 num_opens;
  131. uint32 num_users;
  132. uint32 open_time;
  133. uint32 ptr_usr_name; /* pointer to user name. */
  134. uint32 ptr_net_name; /* pointer to network name (e.g IPC$). */
  135. } CONN_INFO_1;
  136. /* CONN_INFO_1_STR (level 1 connection info strings) */
  137. typedef struct str_conn_info1
  138. {
  139. UNISTR2 uni_usr_name; /* unicode string of user */
  140. UNISTR2 uni_net_name; /* unicode string of name */
  141. } CONN_INFO_1_STR;
  142. /* SRV_CONN_INFO_1 */
  143. typedef struct srv_conn_info_1_info
  144. {
  145. uint32 num_entries_read; /* EntriesRead */
  146. uint32 ptr_conn_info; /* Buffer */
  147. uint32 num_entries_read2; /* EntriesRead */
  148. CONN_INFO_1 info_1 [MAX_CONN_ENTRIES]; /* connection entry pointers */
  149. CONN_INFO_1_STR info_1_str[MAX_CONN_ENTRIES]; /* connection entry strings */
  150. } SRV_CONN_INFO_1;
  151. /* SRV_CONN_INFO_CTR */
  152. typedef struct srv_conn_info_ctr_info
  153. {
  154. uint32 switch_value; /* switch value */
  155. uint32 ptr_conn_ctr; /* pointer to conn info union */
  156. union
  157. {
  158. SRV_CONN_INFO_0 info0; /* connection info level 0 */
  159. SRV_CONN_INFO_1 info1; /* connection info level 1 */
  160. } conn;
  161. } SRV_CONN_INFO_CTR;
  162. /* SRV_Q_NET_CONN_ENUM */
  163. typedef struct q_net_conn_enum_info
  164. {
  165. uint32 ptr_srv_name; /* pointer (to server name) */
  166. UNISTR2 uni_srv_name; /* server name "\\server" */
  167. uint32 ptr_qual_name; /* pointer (to qualifier name) */
  168. UNISTR2 uni_qual_name; /* qualifier name "\\qualifier" */
  169. uint32 conn_level; /* connection level */
  170. SRV_CONN_INFO_CTR *ctr;
  171. uint32 preferred_len; /* preferred maximum length (0xffff ffff) */
  172. ENUM_HND enum_hnd;
  173. } SRV_Q_NET_CONN_ENUM;
  174. /* SRV_R_NET_CONN_ENUM */
  175. typedef struct r_net_conn_enum_info
  176. {
  177. uint32 conn_level; /* share level */
  178. SRV_CONN_INFO_CTR *ctr;
  179. uint32 total_entries; /* total number of entries */
  180. ENUM_HND enum_hnd;
  181. uint32 status; /* return status */
  182. } SRV_R_NET_CONN_ENUM;
  183. /* SH_INFO_1 (pointers to level 1 share info strings) */
  184. typedef struct ptr_share_info1
  185. {
  186. uint32 ptr_netname; /* pointer to net name. */
  187. uint32 type; /* ipc, print, disk ... */
  188. uint32 ptr_remark; /* pointer to comment. */
  189. } SH_INFO_1;
  190. /* SH_INFO_1_STR (level 1 share info strings) */
  191. typedef struct str_share_info1
  192. {
  193. UNISTR2 uni_netname; /* unicode string of net name */
  194. UNISTR2 uni_remark; /* unicode string of comment */
  195. } SH_INFO_1_STR;
  196. /* SRV_SHARE_INFO_1 */
  197. typedef struct share_info_1_info
  198. {
  199. uint32 num_entries_read; /* EntriesRead */
  200. uint32 ptr_share_info; /* Buffer */
  201. uint32 num_entries_read2; /* EntriesRead */
  202. SH_INFO_1 *info_1; /* share entry pointers */
  203. SH_INFO_1_STR *info_1_str; /* share entry strings */
  204. } SRV_SHARE_INFO_1;
  205. /* SH_INFO_2 (pointers to level 2 share info strings) */
  206. typedef struct ptr_share_info2
  207. {
  208. uint32 ptr_netname; /* pointer to net name. */
  209. uint32 type; /* ipc, print, disk ... */
  210. uint32 ptr_remark; /* pointer to comment. */
  211. uint32 perms; /* permissions */
  212. uint32 max_uses; /* maximum uses */
  213. uint32 num_uses; /* current uses */
  214. uint32 ptr_path; /* pointer to path name */
  215. uint32 ptr_passwd; /* pointer to password */
  216. } SH_INFO_2;
  217. /* SH_INFO_2_STR (level 2 share info strings) */
  218. typedef struct str_share_info2
  219. {
  220. UNISTR2 uni_netname; /* unicode string of net name (e.g NETLOGON) */
  221. UNISTR2 uni_remark; /* unicode string of comment (e.g "Logon server share") */
  222. UNISTR2 uni_path; /* unicode string of local path (e.g c:\winnt\system32\repl\import\scripts) */
  223. UNISTR2 uni_passwd; /* unicode string of password - presumably for share level security (e.g NULL) */
  224. } SH_INFO_2_STR;
  225. /* SRV_SHARE_INFO_2 */
  226. typedef struct share_info_2_info
  227. {
  228. uint32 num_entries_read; /* EntriesRead */
  229. uint32 ptr_share_info; /* Buffer */
  230. uint32 num_entries_read2; /* EntriesRead */
  231. SH_INFO_2 *info_2; /* share entry pointers */
  232. SH_INFO_2_STR *info_2_str; /* share entry strings */
  233. } SRV_SHARE_INFO_2;
  234. /* SRV_SHARE_INFO_CTR */
  235. typedef struct srv_share_info_1_info
  236. {
  237. uint32 switch_value; /* switch value */
  238. uint32 ptr_share_ctr; /* pointer to share info union */
  239. union {
  240. SRV_SHARE_INFO_1 info1; /* share info level 1 */
  241. SRV_SHARE_INFO_2 info2; /* share info level 2 */
  242. } share;
  243. } SRV_SHARE_INFO_CTR;
  244. /* SRV_Q_NET_SHARE_ENUM */
  245. typedef struct q_net_share_enum_info
  246. {
  247. uint32 ptr_srv_name; /* pointer (to server name?) */
  248. UNISTR2 uni_srv_name; /* server name */
  249. uint32 share_level; /* share level */
  250. SRV_SHARE_INFO_CTR ctr; /* share info container */
  251. uint32 preferred_len; /* preferred maximum length (0xffff ffff) */
  252. ENUM_HND enum_hnd;
  253. } SRV_Q_NET_SHARE_ENUM;
  254. /* SRV_R_NET_SHARE_ENUM */
  255. typedef struct r_net_share_enum_info
  256. {
  257. uint32 share_level; /* share level */
  258. SRV_SHARE_INFO_CTR ctr; /* share info container */
  259. uint32 total_entries; /* total number of entries */
  260. ENUM_HND enum_hnd;
  261. uint32 status; /* return status */
  262. } SRV_R_NET_SHARE_ENUM;
  263. /* FILE_INFO_3 (level 3 file info strings) */
  264. typedef struct file_info3_info
  265. {
  266. uint32 id; /* file index */
  267. uint32 perms; /* file permissions. don't know what format */
  268. uint32 num_locks; /* file locks */
  269. uint32 ptr_path_name; /* file name */
  270. uint32 ptr_user_name; /* file owner */
  271. } FILE_INFO_3;
  272. /* FILE_INFO_3_STR (level 3 file info strings) */
  273. typedef struct str_file_info3_info
  274. {
  275. UNISTR2 uni_path_name; /* unicode string of file name */
  276. UNISTR2 uni_user_name; /* unicode string of file owner. */
  277. } FILE_INFO_3_STR;
  278. /* oops - this is going to take up a *massive* amount of stack. */
  279. /* the UNISTR2s already have 1024 uint16 chars in them... */
  280. #define MAX_FILE_ENTRIES 32
  281. /* SRV_FILE_INFO_3 */
  282. typedef struct srv_file_info_3
  283. {
  284. uint32 num_entries_read; /* EntriesRead */
  285. uint32 ptr_file_info; /* Buffer */
  286. uint32 num_entries_read2; /* EntriesRead */
  287. FILE_INFO_3 info_3 [MAX_FILE_ENTRIES]; /* file entry details */
  288. FILE_INFO_3_STR info_3_str[MAX_FILE_ENTRIES]; /* file entry strings */
  289. } SRV_FILE_INFO_3;
  290. /* SRV_FILE_INFO_CTR */
  291. typedef struct srv_file_info_3_info
  292. {
  293. uint32 switch_value; /* switch value */
  294. uint32 ptr_file_ctr; /* pointer to file info union */
  295. union
  296. {
  297. SRV_FILE_INFO_3 info3; /* file info with 0 entries */
  298. } file;
  299. } SRV_FILE_INFO_CTR;
  300. /* SRV_Q_NET_FILE_ENUM */
  301. typedef struct q_net_file_enum_info
  302. {
  303. uint32 ptr_srv_name; /* pointer (to server name?) */
  304. UNISTR2 uni_srv_name; /* server name */
  305. uint32 ptr_qual_name; /* pointer (to qualifier name) */
  306. UNISTR2 uni_qual_name; /* qualifier name "\\qualifier" */
  307. uint32 file_level; /* file level */
  308. SRV_FILE_INFO_CTR *ctr;
  309. uint32 preferred_len; /* preferred maximum length (0xffff ffff) */
  310. ENUM_HND enum_hnd;
  311. } SRV_Q_NET_FILE_ENUM;
  312. /* SRV_R_NET_FILE_ENUM */
  313. typedef struct r_net_file_enum_info
  314. {
  315. uint32 file_level; /* file level */
  316. SRV_FILE_INFO_CTR *ctr;
  317. uint32 total_entries; /* total number of files */
  318. ENUM_HND enum_hnd;
  319. uint32 status; /* return status */
  320. } SRV_R_NET_FILE_ENUM;
  321. /* SRV_INFO_101 */
  322. typedef struct srv_info_101_info
  323. {
  324. uint32 platform_id; /* 0x500 */
  325. uint32 ptr_name; /* pointer to server name */
  326. uint32 ver_major; /* 0x4 */
  327. uint32 ver_minor; /* 0x2 */
  328. uint32 srv_type; /* browse etc type */
  329. uint32 ptr_comment; /* pointer to server comment */
  330. UNISTR2 uni_name; /* server name "server" */
  331. UNISTR2 uni_comment; /* server comment "samba x.x.x blah" */
  332. } SRV_INFO_101;
  333. /* SRV_INFO_102 */
  334. typedef struct srv_info_102_info
  335. {
  336. uint32 platform_id; /* 0x500 */
  337. uint32 ptr_name; /* pointer to server name */
  338. uint32 ver_major; /* 0x4 */
  339. uint32 ver_minor; /* 0x2 */
  340. uint32 srv_type; /* browse etc type */
  341. uint32 ptr_comment; /* pointer to server comment */
  342. uint32 users; /* 0xffff ffff*/
  343. uint32 disc; /* 0xf */
  344. uint32 hidden; /* 0x0 */
  345. uint32 announce; /* 240 */
  346. uint32 ann_delta; /* 3000 */
  347. uint32 licenses; /* 0 */
  348. uint32 ptr_usr_path; /* pointer to user path */
  349. UNISTR2 uni_name; /* server name "server" */
  350. UNISTR2 uni_comment; /* server comment "samba x.x.x blah" */
  351. UNISTR2 uni_usr_path; /* "c:\" (eh?) */
  352. } SRV_INFO_102;
  353. /* SRV_INFO_CTR */
  354. typedef struct srv_info_ctr_info
  355. {
  356. uint32 switch_value; /* switch value */
  357. uint32 ptr_srv_ctr; /* pointer to server info */
  358. union
  359. {
  360. SRV_INFO_102 sv102; /* server info level 102 */
  361. SRV_INFO_101 sv101; /* server info level 101 */
  362. } srv;
  363. } SRV_INFO_CTR;
  364. /* SRV_Q_NET_SRV_GET_INFO */
  365. typedef struct q_net_srv_get_info
  366. {
  367. uint32 ptr_srv_name;
  368. UNISTR2 uni_srv_name; /* "\\server" */
  369. uint32 switch_value;
  370. } SRV_Q_NET_SRV_GET_INFO;
  371. /* SRV_R_NET_SRV_GET_INFO */
  372. typedef struct r_net_srv_get_info
  373. {
  374. SRV_INFO_CTR *ctr;
  375. uint32 status; /* return status */
  376. } SRV_R_NET_SRV_GET_INFO;
  377. /* SRV_Q_NET_SRV_SET_INFO */
  378. typedef struct q_net_srv_set_info
  379. {
  380. uint32 ptr_srv_name;
  381. UNISTR2 uni_srv_name; /* "\\server" */
  382. uint32 switch_value;
  383. SRV_INFO_CTR *ctr;
  384. } SRV_Q_NET_SRV_SET_INFO;
  385. /* SRV_R_NET_SRV_SET_INFO */
  386. typedef struct r_net_srv_set_info
  387. {
  388. uint32 switch_value; /* switch value */
  389. uint32 status; /* return status */
  390. } SRV_R_NET_SRV_SET_INFO;
  391. /* SRV_Q_NET_REMOTE_TOD */
  392. typedef struct q_net_remote_tod
  393. {
  394. uint32 ptr_srv_name;
  395. UNISTR2 uni_srv_name; /* "\\server" */
  396. } SRV_Q_NET_REMOTE_TOD;
  397. /* TIME_OF_DAY_INFO */
  398. typedef struct time_of_day_info
  399. {
  400. uint32 elapsedt;
  401. uint32 msecs;
  402. uint32 hours;
  403. uint32 mins;
  404. uint32 secs;
  405. uint32 hunds;
  406. uint32 zone;
  407. uint32 tintervals;
  408. uint32 day;
  409. uint32 month;
  410. uint32 year;
  411. uint32 weekday;
  412. } TIME_OF_DAY_INFO;
  413. /* SRV_R_NET_REMOTE_TOD */
  414. typedef struct r_net_remote_tod
  415. {
  416. uint32 ptr_srv_tod; /* pointer to TOD */
  417. TIME_OF_DAY_INFO *tod;
  418. uint32 status; /* return status */
  419. } SRV_R_NET_REMOTE_TOD;
  420. #endif /* _RPC_SRVSVC_H */