NameFlags.cs 719 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using Utilities;
  5. namespace SMBLibrary.NetBios
  6. {
  7. public enum OwnerNodeType : byte
  8. {
  9. BNode = 0x00,
  10. PNode = 0x01,
  11. MNode = 0x10,
  12. }
  13. public struct NameFlags // ushort
  14. {
  15. public const int Length = 2;
  16. public OwnerNodeType NodeType;
  17. public bool WorkGroup;
  18. public ushort Value
  19. {
  20. get
  21. {
  22. ushort value = (ushort)(((byte)NodeType) << 13);
  23. if (WorkGroup)
  24. {
  25. value |= 0x8000;
  26. }
  27. return value;
  28. }
  29. }
  30. }
  31. }