TransactionPeekNamedPipeRequest.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* Copyright (C) 2014-2017 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
  2. *
  3. * You can redistribute this program and/or modify it under the terms of
  4. * the GNU Lesser Public License as published by the Free Software Foundation,
  5. * either version 3 of the License, or (at your option) any later version.
  6. */
  7. using System;
  8. using System.Collections.Generic;
  9. using System.Text;
  10. using Utilities;
  11. namespace SMBLibrary.SMB1
  12. {
  13. /// <summary>
  14. /// TRANS_PEEK_NMPIPE Request
  15. /// </summary>
  16. public class TransactionPeekNamedPipeRequest : TransactionSubcommand
  17. {
  18. // Setup:
  19. public ushort FID;
  20. public TransactionPeekNamedPipeRequest() : base()
  21. {
  22. }
  23. public TransactionPeekNamedPipeRequest(byte[] setup) : base()
  24. {
  25. FID = LittleEndianConverter.ToUInt16(setup, 2);
  26. }
  27. public override byte[] GetSetup()
  28. {
  29. byte[] setup = new byte[4];
  30. LittleEndianWriter.WriteUInt16(setup, 0, (ushort)this.SubcommandName);
  31. LittleEndianWriter.WriteUInt16(setup, 2, FID);
  32. return setup;
  33. }
  34. public override TransactionSubcommandName SubcommandName
  35. {
  36. get
  37. {
  38. return TransactionSubcommandName.TRANS_PEEK_NMPIPE;
  39. }
  40. }
  41. }
  42. }