1 package jcifs.dcerpc.msrpc; 2 3 import jcifs.dcerpc.*; 4 import jcifs.dcerpc.ndr.*; 5 6 import jcifs.util.Hexdump; 7 8 public class srvsvc { 9 10 public static String getSyntax() { 11 return "4b324fc8-1670-01d3-1278-5a47bf6ee188:3.0"; 12 } 13 14 public static class ShareInfo0 extends NdrObject { 15 16 public String netname; 17 18 public void encode(NdrBuffer _dst) throws NdrException { 19 _dst.align(4); 20 _dst.enc_ndr_referent(netname, 1); 21 22 if (netname != null) { 23 _dst = _dst.deferred; 24 _dst.enc_ndr_string(netname); 25 26 } 27 } 28 public void decode(NdrBuffer _src) throws NdrException { 29 _src.align(4); 30 int _netnamep = _src.dec_ndr_long(); 31 32 if (_netnamep != 0) { 33 _src = _src.deferred; 34 netname = _src.dec_ndr_string(); 35 36 } 37 } 38 } 39 public static class ShareInfoCtr0 extends NdrObject { 40 41 public int count; 42 public ShareInfo0[] array; 43 44 public void encode(NdrBuffer _dst) throws NdrException { 45 _dst.align(4); 46 _dst.enc_ndr_long(count); 47 _dst.enc_ndr_referent(array, 1); 48 49 if (array != null) { 50 _dst = _dst.deferred; 51 int _arrays = count; 52 _dst.enc_ndr_long(_arrays); 53 int _arrayi = _dst.index; 54 _dst.advance(4 * _arrays); 55 56 _dst = _dst.derive(_arrayi); 57 for (int _i = 0; _i < _arrays; _i++) { 58 array[_i].encode(_dst); 59 } 60 } 61 } 62 public void decode(NdrBuffer _src) throws NdrException { 63 _src.align(4); 64 count = (int)_src.dec_ndr_long(); 65 int _arrayp = _src.dec_ndr_long(); 66 67 if (_arrayp != 0) { 68 _src = _src.deferred; 69 int _arrays = _src.dec_ndr_long(); 70 int _arrayi = _src.index; 71 _src.advance(4 * _arrays); 72 73 if (array == null) { 74 if (_arrays < 0 || _arrays > 0xFFFF) throw new NdrException( NdrException.INVALID_CONFORMANCE ); 75 array = new ShareInfo0[_arrays]; 76 } 77 _src = _src.derive(_arrayi); 78 for (int _i = 0; _i < _arrays; _i++) { 79 if (array[_i] == null) { 80 array[_i] = new ShareInfo0(); 81 } 82 array[_i].decode(_src); 83 } 84 } 85 } 86 } 87 public static class ShareInfo1 extends NdrObject { 88 89 public String netname; 90 public int type; 91 public String remark; 92 93 public void encode(NdrBuffer _dst) throws NdrException { 94 _dst.align(4); 95 _dst.enc_ndr_referent(netname, 1); 96 _dst.enc_ndr_long(type); 97 _dst.enc_ndr_referent(remark, 1); 98 99 if (netname != null) { 100 _dst = _dst.deferred; 101 _dst.enc_ndr_string(netname); 102 103 } 104 if (remark != null) { 105 _dst = _dst.deferred; 106 _dst.enc_ndr_string(remark); 107 108 } 109 } 110 public void decode(NdrBuffer _src) throws NdrException { 111 _src.align(4); 112 int _netnamep = _src.dec_ndr_long(); 113 type = (int)_src.dec_ndr_long(); 114 int _remarkp = _src.dec_ndr_long(); 115 116 if (_netnamep != 0) { 117 _src = _src.deferred; 118 netname = _src.dec_ndr_string(); 119 120 } 121 if (_remarkp != 0) { 122 _src = _src.deferred; 123 remark = _src.dec_ndr_string(); 124 125 } 126 } 127 } 128 public static class ShareInfoCtr1 extends NdrObject { 129 130 public int count; 131 public ShareInfo1[] array; 132 133 public void encode(NdrBuffer _dst) throws NdrException { 134 _dst.align(4); 135 _dst.enc_ndr_long(count); 136 _dst.enc_ndr_referent(array, 1); 137 138 if (array != null) { 139 _dst = _dst.deferred; 140 int _arrays = count; 141 _dst.enc_ndr_long(_arrays); 142 int _arrayi = _dst.index; 143 _dst.advance(12 * _arrays); 144 145 _dst = _dst.derive(_arrayi); 146 for (int _i = 0; _i < _arrays; _i++) { 147 array[_i].encode(_dst); 148 } 149 } 150 } 151 public void decode(NdrBuffer _src) throws NdrException { 152 _src.align(4); 153 count = (int)_src.dec_ndr_long(); 154 int _arrayp = _src.dec_ndr_long(); 155 156 if (_arrayp != 0) { 157 _src = _src.deferred; 158 int _arrays = _src.dec_ndr_long(); 159 int _arrayi = _src.index; 160 _src.advance(12 * _arrays); 161 162 if (array == null) { 163 if (_arrays < 0 || _arrays > 0xFFFF) throw new NdrException( NdrException.INVALID_CONFORMANCE ); 164 array = new ShareInfo1[_arrays]; 165 } 166 _src = _src.derive(_arrayi); 167 for (int _i = 0; _i < _arrays; _i++) { 168 if (array[_i] == null) { 169 array[_i] = new ShareInfo1(); 170 } 171 array[_i].decode(_src); 172 } 173 } 174 } 175 } 176 public static class ShareInfo502 extends NdrObject { 177 178 public String netname; 179 public int type; 180 public String remark; 181 public int permissions; 182 public int max_uses; 183 public int current_uses; 184 public String path; 185 public String password; 186 public int sd_size; 187 public byte[] security_descriptor; 188 189 public void encode(NdrBuffer _dst) throws NdrException { 190 _dst.align(4); 191 _dst.enc_ndr_referent(netname, 1); 192 _dst.enc_ndr_long(type); 193 _dst.enc_ndr_referent(remark, 1); 194 _dst.enc_ndr_long(permissions); 195 _dst.enc_ndr_long(max_uses); 196 _dst.enc_ndr_long(current_uses); 197 _dst.enc_ndr_referent(path, 1); 198 _dst.enc_ndr_referent(password, 1); 199 _dst.enc_ndr_long(sd_size); 200 _dst.enc_ndr_referent(security_descriptor, 1); 201 202 if (netname != null) { 203 _dst = _dst.deferred; 204 _dst.enc_ndr_string(netname); 205 206 } 207 if (remark != null) { 208 _dst = _dst.deferred; 209 _dst.enc_ndr_string(remark); 210 211 } 212 if (path != null) { 213 _dst = _dst.deferred; 214 _dst.enc_ndr_string(path); 215 216 } 217 if (password != null) { 218 _dst = _dst.deferred; 219 _dst.enc_ndr_string(password); 220 221 } 222 if (security_descriptor != null) { 223 _dst = _dst.deferred; 224 int _security_descriptors = sd_size; 225 _dst.enc_ndr_long(_security_descriptors); 226 int _security_descriptori = _dst.index; 227 _dst.advance(1 * _security_descriptors); 228 229 _dst = _dst.derive(_security_descriptori); 230 for (int _i = 0; _i < _security_descriptors; _i++) { 231 _dst.enc_ndr_small(security_descriptor[_i]); 232 } 233 } 234 } 235 public void decode(NdrBuffer _src) throws NdrException { 236 _src.align(4); 237 int _netnamep = _src.dec_ndr_long(); 238 type = (int)_src.dec_ndr_long(); 239 int _remarkp = _src.dec_ndr_long(); 240 permissions = (int)_src.dec_ndr_long(); 241 max_uses = (int)_src.dec_ndr_long(); 242 current_uses = (int)_src.dec_ndr_long(); 243 int _pathp = _src.dec_ndr_long(); 244 int _passwordp = _src.dec_ndr_long(); 245 sd_size = (int)_src.dec_ndr_long(); 246 int _security_descriptorp = _src.dec_ndr_long(); 247 248 if (_netnamep != 0) { 249 _src = _src.deferred; 250 netname = _src.dec_ndr_string(); 251 252 } 253 if (_remarkp != 0) { 254 _src = _src.deferred; 255 remark = _src.dec_ndr_string(); 256 257 } 258 if (_pathp != 0) { 259 _src = _src.deferred; 260 path = _src.dec_ndr_string(); 261 262 } 263 if (_passwordp != 0) { 264 _src = _src.deferred; 265 password = _src.dec_ndr_string(); 266 267 } 268 if (_security_descriptorp != 0) { 269 _src = _src.deferred; 270 int _security_descriptors = _src.dec_ndr_long(); 271 int _security_descriptori = _src.index; 272 _src.advance(1 * _security_descriptors); 273 274 if (security_descriptor == null) { 275 if (_security_descriptors < 0 || _security_descriptors > 0xFFFF) throw new NdrException( NdrException.INVALID_CONFORMANCE ); 276 security_descriptor = new byte[_security_descriptors]; 277 } 278 _src = _src.derive(_security_descriptori); 279 for (int _i = 0; _i < _security_descriptors; _i++) { 280 security_descriptor[_i] = (byte)_src.dec_ndr_small(); 281 } 282 } 283 } 284 } 285 public static class ShareInfoCtr502 extends NdrObject { 286 287 public int count; 288 public ShareInfo502[] array; 289 290 public void encode(NdrBuffer _dst) throws NdrException { 291 _dst.align(4); 292 _dst.enc_ndr_long(count); 293 _dst.enc_ndr_referent(array, 1); 294 295 if (array != null) { 296 _dst = _dst.deferred; 297 int _arrays = count; 298 _dst.enc_ndr_long(_arrays); 299 int _arrayi = _dst.index; 300 _dst.advance(40 * _arrays); 301 302 _dst = _dst.derive(_arrayi); 303 for (int _i = 0; _i < _arrays; _i++) { 304 array[_i].encode(_dst); 305 } 306 } 307 } 308 public void decode(NdrBuffer _src) throws NdrException { 309 _src.align(4); 310 count = (int)_src.dec_ndr_long(); 311 int _arrayp = _src.dec_ndr_long(); 312 313 if (_arrayp != 0) { 314 _src = _src.deferred; 315 int _arrays = _src.dec_ndr_long(); 316 int _arrayi = _src.index; 317 _src.advance(40 * _arrays); 318 319 if (array == null) { 320 if (_arrays < 0 || _arrays > 0xFFFF) throw new NdrException( NdrException.INVALID_CONFORMANCE ); 321 array = new ShareInfo502[_arrays]; 322 } 323 _src = _src.derive(_arrayi); 324 for (int _i = 0; _i < _arrays; _i++) { 325 if (array[_i] == null) { 326 array[_i] = new ShareInfo502(); 327 } 328 array[_i].decode(_src); 329 } 330 } 331 } 332 } 333 public static class ShareEnumAll extends DcerpcMessage { 334 335 public int getOpnum() { return 0x0f; } 336 337 public int retval; 338 public String servername; 339 public int level; 340 public NdrObject info; 341 public int prefmaxlen; 342 public int totalentries; 343 public int resume_handle; 344 345 public ShareEnumAll(String servername, 346 int level, 347 NdrObject info, 348 int prefmaxlen, 349 int totalentries, 350 int resume_handle) { 351 this.servername = servername; 352 this.level = level; 353 this.info = info; 354 this.prefmaxlen = prefmaxlen; 355 this.totalentries = totalentries; 356 this.resume_handle = resume_handle; 357 } 358 359 public void encode_in(NdrBuffer _dst) throws NdrException { 360 _dst.enc_ndr_referent(servername, 1); 361 if (servername != null) { 362 _dst.enc_ndr_string(servername); 363 364 } 365 _dst.enc_ndr_long(level); 366 int _descr = level; 367 _dst.enc_ndr_long(_descr); 368 _dst.enc_ndr_referent(info, 1); 369 if (info != null) { 370 _dst = _dst.deferred; 371 info.encode(_dst); 372 373 } 374 _dst.enc_ndr_long(prefmaxlen); 375 _dst.enc_ndr_long(resume_handle); 376 } 377 public void decode_out(NdrBuffer _src) throws NdrException { 378 level = (int)_src.dec_ndr_long(); 379 _src.dec_ndr_long(); 380 int _infop = _src.dec_ndr_long(); 381 if (_infop != 0) { 382 if (info == null) { 383 info = new ShareInfoCtr0(); 384 } 385 _src = _src.deferred; 386 info.decode(_src); 387 388 } 389 totalentries = (int)_src.dec_ndr_long(); 390 resume_handle = (int)_src.dec_ndr_long(); 391 retval = (int)_src.dec_ndr_long(); 392 } 393 } 394 public static class ShareGetInfo extends DcerpcMessage { 395 396 public int getOpnum() { return 0x10; } 397 398 public int retval; 399 public String servername; 400 public String sharename; 401 public int level; 402 public NdrObject info; 403 404 public ShareGetInfo(String servername, 405 String sharename, 406 int level, 407 NdrObject info) { 408 this.servername = servername; 409 this.sharename = sharename; 410 this.level = level; 411 this.info = info; 412 } 413 414 public void encode_in(NdrBuffer _dst) throws NdrException { 415 _dst.enc_ndr_referent(servername, 1); 416 if (servername != null) { 417 _dst.enc_ndr_string(servername); 418 419 } 420 _dst.enc_ndr_string(sharename); 421 _dst.enc_ndr_long(level); 422 } 423 public void decode_out(NdrBuffer _src) throws NdrException { 424 _src.dec_ndr_long(); 425 int _infop = _src.dec_ndr_long(); 426 if (_infop != 0) { 427 if (info == null) { 428 info = new ShareInfo0(); 429 } 430 _src = _src.deferred; 431 info.decode(_src); 432 433 } 434 retval = (int)_src.dec_ndr_long(); 435 } 436 } 437 public static class ServerInfo100 extends NdrObject { 438 439 public int platform_id; 440 public String name; 441 442 public void encode(NdrBuffer _dst) throws NdrException { 443 _dst.align(4); 444 _dst.enc_ndr_long(platform_id); 445 _dst.enc_ndr_referent(name, 1); 446 447 if (name != null) { 448 _dst = _dst.deferred; 449 _dst.enc_ndr_string(name); 450 451 } 452 } 453 public void decode(NdrBuffer _src) throws NdrException { 454 _src.align(4); 455 platform_id = (int)_src.dec_ndr_long(); 456 int _namep = _src.dec_ndr_long(); 457 458 if (_namep != 0) { 459 _src = _src.deferred; 460 name = _src.dec_ndr_string(); 461 462 } 463 } 464 } 465 public static class ServerGetInfo extends DcerpcMessage { 466 467 public int getOpnum() { return 0x15; } 468 469 public int retval; 470 public String servername; 471 public int level; 472 public NdrObject info; 473 474 public ServerGetInfo(String servername, int level, NdrObject info) { 475 this.servername = servername; 476 this.level = level; 477 this.info = info; 478 } 479 480 public void encode_in(NdrBuffer _dst) throws NdrException { 481 _dst.enc_ndr_referent(servername, 1); 482 if (servername != null) { 483 _dst.enc_ndr_string(servername); 484 485 } 486 _dst.enc_ndr_long(level); 487 } 488 public void decode_out(NdrBuffer _src) throws NdrException { 489 _src.dec_ndr_long(); 490 int _infop = _src.dec_ndr_long(); 491 if (_infop != 0) { 492 if (info == null) { 493 info = new ServerInfo100(); 494 } 495 _src = _src.deferred; 496 info.decode(_src); 497 498 } 499 retval = (int)_src.dec_ndr_long(); 500 } 501 } 502 public static class TimeOfDayInfo extends NdrObject { 503 504 public int elapsedt; 505 public int msecs; 506 public int hours; 507 public int mins; 508 public int secs; 509 public int hunds; 510 public int timezone; 511 public int tinterval; 512 public int day; 513 public int month; 514 public int year; 515 public int weekday; 516 517 public void encode(NdrBuffer _dst) throws NdrException { 518 _dst.align(4); 519 _dst.enc_ndr_long(elapsedt); 520 _dst.enc_ndr_long(msecs); 521 _dst.enc_ndr_long(hours); 522 _dst.enc_ndr_long(mins); 523 _dst.enc_ndr_long(secs); 524 _dst.enc_ndr_long(hunds); 525 _dst.enc_ndr_long(timezone); 526 _dst.enc_ndr_long(tinterval); 527 _dst.enc_ndr_long(day); 528 _dst.enc_ndr_long(month); 529 _dst.enc_ndr_long(year); 530 _dst.enc_ndr_long(weekday); 531 532 } 533 public void decode(NdrBuffer _src) throws NdrException { 534 _src.align(4); 535 elapsedt = (int)_src.dec_ndr_long(); 536 msecs = (int)_src.dec_ndr_long(); 537 hours = (int)_src.dec_ndr_long(); 538 mins = (int)_src.dec_ndr_long(); 539 secs = (int)_src.dec_ndr_long(); 540 hunds = (int)_src.dec_ndr_long(); 541 timezone = (int)_src.dec_ndr_long(); 542 tinterval = (int)_src.dec_ndr_long(); 543 day = (int)_src.dec_ndr_long(); 544 month = (int)_src.dec_ndr_long(); 545 year = (int)_src.dec_ndr_long(); 546 weekday = (int)_src.dec_ndr_long(); 547 548 } 549 } 550 public static class RemoteTOD extends DcerpcMessage { 551 552 public int getOpnum() { return 0x1c; } 553 554 public int retval; 555 public String servername; 556 public TimeOfDayInfo info; 557 558 public RemoteTOD(String servername, TimeOfDayInfo info) { 559 this.servername = servername; 560 this.info = info; 561 } 562 563 public void encode_in(NdrBuffer _dst) throws NdrException { 564 _dst.enc_ndr_referent(servername, 1); 565 if (servername != null) { 566 _dst.enc_ndr_string(servername); 567 568 } 569 } 570 public void decode_out(NdrBuffer _src) throws NdrException { 571 int _infop = _src.dec_ndr_long(); 572 if (_infop != 0) { 573 if (info == null) { 574 info = new TimeOfDayInfo(); 575 } 576 info.decode(_src); 577 578 } 579 retval = (int)_src.dec_ndr_long(); 580 } 581 } 582 } 583 | Popular Tags |