Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

392 lines
9.9 KiB

  1. #include "interpre.h"
  2. #define INCL_NOCOMMON
  3. #include <os2.h>
  4. #define USE 600
  5. #define VIEW 601
  6. #define EOS EOF
  7. #include <stdio.h>
  8. #include <lmcons.h>
  9. #include <lmshare.h>
  10. #include "netcmds.h"
  11. #include "nettext.h"
  12. #include "swtchtbl.h"
  13. #include "os2incl.h"
  14. extern void call_net1(void) ;
  15. char *Rule_strings[] = {
  16. 0
  17. };
  18. short Index_strings[] = {
  19. 0
  20. };
  21. #define _net 0
  22. #define _use 11
  23. #define _view 78
  24. #define _unknown 89
  25. #define _no_command 92
  26. #define _device_or_wildcard 95
  27. #define _device_name 98
  28. #define _resource_name 101
  29. #define _netname 104
  30. #define _username 107
  31. #define _qualified_username 110
  32. #define _pass 113
  33. #define _networkname 116
  34. #define _networkname2 119
  35. TCHAR XXtype[] = {
  36. /* 0 */ X_OR, /* 3 */
  37. /* 1 */ X_PROC, /* _no_command */
  38. /* 2 */ X_ACCEPT, /* 123 */
  39. /* 3 */ X_OR, /* 6 */
  40. /* 4 */ X_PROC, /* _use */
  41. /* 5 */ X_ACCEPT, /* 124 */
  42. /* 6 */ X_OR, /* 9 */
  43. /* 7 */ X_PROC, /* _view */
  44. /* 8 */ X_ACCEPT, /* 125 */
  45. /* 9 */ X_PROC, /* _unknown */
  46. /* 10 */ X_ACCEPT, /* 127 */
  47. /* 11 */ X_TOKEN, /* (short)USE */
  48. /* 12 */ X_CONDIT, /* 0 */
  49. /* 13 */ X_OR, /* 24 */
  50. /* 14 */ X_TOKEN, /* (short)EOS */
  51. /* 15 */ X_OR, /* 19 */
  52. /* 16 */ X_CONDIT, /* 1 */
  53. /* 17 */ X_ACTION, /* 0 */
  54. /* 18 */ X_ACCEPT, /* 137 */
  55. /* 19 */ X_SWITCH, /* 0 */
  56. /* 20 */ X_CONDIT, /* 2 */
  57. /* 21 */ X_ACTION, /* 1 */
  58. /* 22 */ X_ACCEPT, /* 140 */
  59. /* 23 */ X_ACCEPT, /* 141 */
  60. /* 24 */ X_OR, /* 41 */
  61. /* 25 */ X_PROC, /* _networkname */
  62. /* 26 */ X_OR, /* 36 */
  63. /* 27 */ X_TOKEN, /* (short)EOS */
  64. /* 28 */ X_OR, /* 33 */
  65. /* 29 */ X_SWITCH, /* 1 */
  66. /* 30 */ X_CONDIT, /* 3 */
  67. /* 31 */ X_ACTION, /* 2 */
  68. /* 32 */ X_ACCEPT, /* 148 */
  69. /* 33 */ X_ACTION, /* 3 */
  70. /* 34 */ X_ACCEPT, /* 152 */
  71. /* 35 */ X_ACCEPT, /* 153 */
  72. /* 36 */ X_PROC, /* _pass */
  73. /* 37 */ X_TOKEN, /* (short)EOS */
  74. /* 38 */ X_ACTION, /* 4 */
  75. /* 39 */ X_ACCEPT, /* 156 */
  76. /* 40 */ X_ACCEPT, /* 157 */
  77. /* 41 */ X_PROC, /* _device_or_wildcard */
  78. /* 42 */ X_OR, /* 57 */
  79. /* 43 */ X_TOKEN, /* (short)EOS */
  80. /* 44 */ X_OR, /* 48 */
  81. /* 45 */ X_CONDIT, /* 4 */
  82. /* 46 */ X_ACTION, /* 5 */
  83. /* 47 */ X_ACCEPT, /* 164 */
  84. /* 48 */ X_OR, /* 53 */
  85. /* 49 */ X_SWITCH, /* 1 */
  86. /* 50 */ X_CONDIT, /* 5 */
  87. /* 51 */ X_ACTION, /* 6 */
  88. /* 52 */ X_ACCEPT, /* 167 */
  89. /* 53 */ X_SWITCH, /* 2 */
  90. /* 54 */ X_ACTION, /* 7 */
  91. /* 55 */ X_ACCEPT, /* 170 */
  92. /* 56 */ X_ACCEPT, /* 171 */
  93. /* 57 */ X_OR, /* 64 */
  94. /* 58 */ X_PROC, /* _pass */
  95. /* 59 */ X_TOKEN, /* (short)EOS */
  96. /* 60 */ X_SWITCH, /* 2 */
  97. /* 61 */ X_ACTION, /* 8 */
  98. /* 62 */ X_ACCEPT, /* 176 */
  99. /* 63 */ X_ACCEPT, /* 177 */
  100. /* 64 */ X_PROC, /* _networkname */
  101. /* 65 */ X_OR, /* 71 */
  102. /* 66 */ X_PROC, /* _pass */
  103. /* 67 */ X_TOKEN, /* (short)EOS */
  104. /* 68 */ X_ACTION, /* 9 */
  105. /* 69 */ X_ACCEPT, /* 192 */
  106. /* 70 */ X_ACCEPT, /* 193 */
  107. /* 71 */ X_TOKEN, /* (short)EOS */
  108. /* 72 */ X_ACTION, /* 10 */
  109. /* 73 */ X_ACCEPT, /* 206 */
  110. /* 74 */ X_ACCEPT, /* 207 */
  111. /* 75 */ X_ACCEPT, /* 208 */
  112. /* 76 */ X_ACCEPT, /* 209 */
  113. /* 77 */ X_ACCEPT, /* 209 */
  114. /* 78 */ X_TOKEN, /* (short)VIEW */
  115. /* 79 */ X_CONDIT, /* 6 */
  116. /* 80 */ X_OR, /* 84 */
  117. /* 81 */ X_TOKEN, /* (short)EOS */
  118. /* 82 */ X_ACTION, /* 11 */
  119. /* 83 */ X_ACCEPT, /* 216 */
  120. /* 84 */ X_PROC, /* _networkname2 */
  121. /* 85 */ X_TOKEN, /* (short)EOS */
  122. /* 86 */ X_ACTION, /* 12 */
  123. /* 87 */ X_ACCEPT, /* 219 */
  124. /* 88 */ X_ACCEPT, /* 219 */
  125. /* 89 */ X_ANY, /* 0 */
  126. /* 90 */ X_ACTION, /* 13 */
  127. /* 91 */ X_ACCEPT, /* 228 */
  128. /* 92 */ X_TOKEN, /* (short)EOS */
  129. /* 93 */ X_ACTION, /* 14 */
  130. /* 94 */ X_ACCEPT, /* 232 */
  131. /* 95 */ X_ANY, /* 0 */
  132. /* 96 */ X_CONDIT, /* 7 */
  133. /* 97 */ X_ACCEPT, /* 239 */
  134. /* 98 */ X_ANY, /* 0 */
  135. /* 99 */ X_CONDIT, /* 8 */
  136. /* 100 */ X_ACCEPT, /* 241 */
  137. /* 101 */ X_ANY, /* 0 */
  138. /* 102 */ X_CONDIT, /* 9 */
  139. /* 103 */ X_ACCEPT, /* 243 */
  140. /* 104 */ X_ANY, /* 0 */
  141. /* 105 */ X_CONDIT, /* 10 */
  142. /* 106 */ X_ACCEPT, /* 245 */
  143. /* 107 */ X_ANY, /* 0 */
  144. /* 108 */ X_CONDIT, /* 11 */
  145. /* 109 */ X_ACCEPT, /* 247 */
  146. /* 110 */ X_ANY, /* 0 */
  147. /* 111 */ X_CONDIT, /* 12 */
  148. /* 112 */ X_ACCEPT, /* 249 */
  149. /* 113 */ X_ANY, /* 0 */
  150. /* 114 */ X_CONDIT, /* 13 */
  151. /* 115 */ X_ACCEPT, /* 251 */
  152. /* 116 */ X_ANY, /* 0 */
  153. /* 117 */ X_CONDIT, /* 14 */
  154. /* 118 */ X_ACCEPT, /* 253 */
  155. /* 119 */ X_ANY, /* 0 */
  156. /* 120 */ X_CONDIT, /* 15 */
  157. /* 121 */ X_ACCEPT, /* 255 */
  158. };
  159. short XXvalues[] = {
  160. /* 0 */ 3,
  161. /* 1 */ _no_command,
  162. /* 2 */ 123,
  163. /* 3 */ 6,
  164. /* 4 */ _use,
  165. /* 5 */ 124,
  166. /* 6 */ 9,
  167. /* 7 */ _view,
  168. /* 8 */ 125,
  169. /* 9 */ _unknown,
  170. /* 10 */ 127,
  171. /* 11 */ (short)USE,
  172. /* 12 */ 0,
  173. /* 13 */ 24,
  174. /* 14 */ (short)EOS,
  175. /* 15 */ 19,
  176. /* 16 */ 1,
  177. /* 17 */ 0,
  178. /* 18 */ 137,
  179. /* 19 */ 0,
  180. /* 20 */ 2,
  181. /* 21 */ 1,
  182. /* 22 */ 140,
  183. /* 23 */ 141,
  184. /* 24 */ 41,
  185. /* 25 */ _networkname,
  186. /* 26 */ 36,
  187. /* 27 */ (short)EOS,
  188. /* 28 */ 33,
  189. /* 29 */ 1,
  190. /* 30 */ 3,
  191. /* 31 */ 2,
  192. /* 32 */ 148,
  193. /* 33 */ 3,
  194. /* 34 */ 152,
  195. /* 35 */ 153,
  196. /* 36 */ _pass,
  197. /* 37 */ (short)EOS,
  198. /* 38 */ 4,
  199. /* 39 */ 156,
  200. /* 40 */ 157,
  201. /* 41 */ _device_or_wildcard,
  202. /* 42 */ 57,
  203. /* 43 */ (short)EOS,
  204. /* 44 */ 48,
  205. /* 45 */ 4,
  206. /* 46 */ 5,
  207. /* 47 */ 164,
  208. /* 48 */ 53,
  209. /* 49 */ 1,
  210. /* 50 */ 5,
  211. /* 51 */ 6,
  212. /* 52 */ 167,
  213. /* 53 */ 2,
  214. /* 54 */ 7,
  215. /* 55 */ 170,
  216. /* 56 */ 171,
  217. /* 57 */ 64,
  218. /* 58 */ _pass,
  219. /* 59 */ (short)EOS,
  220. /* 60 */ 2,
  221. /* 61 */ 8,
  222. /* 62 */ 176,
  223. /* 63 */ 177,
  224. /* 64 */ _networkname,
  225. /* 65 */ 71,
  226. /* 66 */ _pass,
  227. /* 67 */ (short)EOS,
  228. /* 68 */ 9,
  229. /* 69 */ 192,
  230. /* 70 */ 193,
  231. /* 71 */ (short)EOS,
  232. /* 72 */ 10,
  233. /* 73 */ 206,
  234. /* 74 */ 207,
  235. /* 75 */ 208,
  236. /* 76 */ 209,
  237. /* 77 */ 209,
  238. /* 78 */ (short)VIEW,
  239. /* 79 */ 6,
  240. /* 80 */ 84,
  241. /* 81 */ (short)EOS,
  242. /* 82 */ 11,
  243. /* 83 */ 216,
  244. /* 84 */ _networkname2,
  245. /* 85 */ (short)EOS,
  246. /* 86 */ 12,
  247. /* 87 */ 219,
  248. /* 88 */ 219,
  249. /* 89 */ 0,
  250. /* 90 */ 13,
  251. /* 91 */ 228,
  252. /* 92 */ (short)EOS,
  253. /* 93 */ 14,
  254. /* 94 */ 232,
  255. /* 95 */ 0,
  256. /* 96 */ 7,
  257. /* 97 */ 239,
  258. /* 98 */ 0,
  259. /* 99 */ 8,
  260. /* 100 */ 241,
  261. /* 101 */ 0,
  262. /* 102 */ 9,
  263. /* 103 */ 243,
  264. /* 104 */ 0,
  265. /* 105 */ 10,
  266. /* 106 */ 245,
  267. /* 107 */ 0,
  268. /* 108 */ 11,
  269. /* 109 */ 247,
  270. /* 110 */ 0,
  271. /* 111 */ 12,
  272. /* 112 */ 249,
  273. /* 113 */ 0,
  274. /* 114 */ 13,
  275. /* 115 */ 251,
  276. /* 116 */ 0,
  277. /* 117 */ 14,
  278. /* 118 */ 253,
  279. /* 119 */ 0,
  280. /* 120 */ 15,
  281. /* 121 */ 255,
  282. };
  283. extern TCHAR * XXnode;
  284. xxcondition(index,xxvar)int index;register TCHAR * xxvar[]; {switch(index) {
  285. #line 131 "msnet.nt"
  286. case 0 :
  287. return(ValidateSwitches(0,use_switches));
  288. #line 135 "msnet.nt"
  289. case 1 :
  290. return(noswitch());
  291. #line 138 "msnet.nt"
  292. case 2 :
  293. return(oneswitch());
  294. #line 146 "msnet.nt"
  295. case 3 :
  296. return(oneswitch());
  297. #line 162 "msnet.nt"
  298. case 4 :
  299. return(noswitch());
  300. #line 165 "msnet.nt"
  301. case 5 :
  302. return(oneswitch());
  303. #line 212 "msnet.nt"
  304. case 6 :
  305. return(ValidateSwitches(0,view_switches));
  306. #line 239 "msnet.nt"
  307. case 7 :
  308. return(IsDeviceName(xxvar[0]) || IsWildCard(xxvar[0]));
  309. #line 241 "msnet.nt"
  310. case 8 :
  311. return(IsDeviceName(xxvar[0]));
  312. #line 243 "msnet.nt"
  313. case 9 :
  314. return(IsResource(xxvar[0]));
  315. #line 245 "msnet.nt"
  316. case 10 :
  317. return(IsNetname(xxvar[0]));
  318. #line 247 "msnet.nt"
  319. case 11 :
  320. return(IsUsername(xxvar[0]));
  321. #line 249 "msnet.nt"
  322. case 12 :
  323. return(IsQualifiedUsername(xxvar[0]));
  324. #line 251 "msnet.nt"
  325. case 13 :
  326. return(IsPassword(xxvar[0]));
  327. #line 253 "msnet.nt"
  328. case 14 :
  329. return(!IsDeviceName(xxvar[0]) && !IsWildCard(xxvar[0]));
  330. #line 255 "msnet.nt"
  331. case 15 :
  332. return(!IsWildCard(xxvar[0]));
  333. } return FALSE; }
  334. xxaction(index,xxvar)int index;register TCHAR * xxvar[]; {switch(index) {
  335. #line 136 "msnet.nt"
  336. case 0 :
  337. {use_display_all(); } break;
  338. #line 139 "msnet.nt"
  339. case 1 :
  340. {use_set_remembered(); } break;
  341. #line 147 "msnet.nt"
  342. case 2 :
  343. {use_del(xxvar[1], TRUE, TRUE); } break;
  344. #line 151 "msnet.nt"
  345. case 3 :
  346. {use_unc(xxvar[1]); } break;
  347. #line 155 "msnet.nt"
  348. case 4 :
  349. {use_add(NULL, xxvar[1], xxvar[2], FALSE, TRUE); } break;
  350. #line 163 "msnet.nt"
  351. case 5 :
  352. {use_display_dev(xxvar[1]); } break;
  353. #line 166 "msnet.nt"
  354. case 6 :
  355. {use_del(xxvar[1], FALSE, TRUE); } break;
  356. #line 169 "msnet.nt"
  357. case 7 :
  358. {use_add_home(xxvar[1], NULL); } break;
  359. #line 175 "msnet.nt"
  360. case 8 :
  361. {use_add_home(xxvar[1], xxvar[2]); } break;
  362. #line 182 "msnet.nt"
  363. case 9 :
  364. {use_add(xxvar[1], xxvar[2], xxvar[3], FALSE, TRUE); } break;
  365. #line 196 "msnet.nt"
  366. case 10 :
  367. {use_add(xxvar[1], xxvar[2], NULL, FALSE, TRUE); } break;
  368. #line 215 "msnet.nt"
  369. case 11 :
  370. {view_display(NULL); } break;
  371. #line 218 "msnet.nt"
  372. case 12 :
  373. {view_display(xxvar[1]); } break;
  374. #line 227 "msnet.nt"
  375. case 13 :
  376. {call_net1(); } break;
  377. #line 231 "msnet.nt"
  378. case 14 :
  379. {call_net1(); } break;
  380. } return 0; }
  381. TCHAR * xxswitch[] = {
  382. TEXT("/PERSISTENT"),
  383. TEXT("/DELETE"),
  384. TEXT("/HOME"),
  385. };