NodeStatusRequest.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // This code is derived from jcifs smb client library <jcifs at samba dot org>
  2. // Ported by J. Arturo <webmaster at komodosoft dot net>
  3. //
  4. // This library is free software; you can redistribute it and/or
  5. // modify it under the terms of the GNU Lesser General Public
  6. // License as published by the Free Software Foundation; either
  7. // version 2.1 of the License, or (at your option) any later version.
  8. //
  9. // This library is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. // Lesser General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU Lesser General Public
  15. // License along with this library; if not, write to the Free Software
  16. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. namespace SharpCifs.Netbios
  18. {
  19. internal class NodeStatusRequest : NameServicePacket
  20. {
  21. internal NodeStatusRequest(Name name)
  22. {
  23. QuestionName = name;
  24. QuestionType = Nbstat;
  25. IsRecurDesired = false;
  26. IsBroadcast = false;
  27. }
  28. internal override int WriteBodyWireFormat(byte[] dst, int dstIndex)
  29. {
  30. int tmp = QuestionName.HexCode;
  31. QuestionName.HexCode = unchecked(0x00);
  32. // type has to be 0x00 for node status
  33. int result = WriteQuestionSectionWireFormat(dst, dstIndex);
  34. QuestionName.HexCode = tmp;
  35. return result;
  36. }
  37. internal override int ReadBodyWireFormat(byte[] src, int srcIndex)
  38. {
  39. return 0;
  40. }
  41. internal override int WriteRDataWireFormat(byte[] dst, int dstIndex)
  42. {
  43. return 0;
  44. }
  45. internal override int ReadRDataWireFormat(byte[] src, int srcIndex)
  46. {
  47. return 0;
  48. }
  49. public override string ToString()
  50. {
  51. return "NodeStatusRequest[" + base.ToString() + "]";
  52. }
  53. }
  54. }