12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Text;
- using Utilities;
- namespace SMBLibrary.NetBios
- {
-
-
-
- public class QuestionSection
- {
- public string Name;
- public NameRecordType Type = NameRecordType.NB;
- public ushort Class = 0x0001;
- public QuestionSection()
- {
- }
- public QuestionSection(byte[] buffer, ref int offset)
- {
- Name = NetBiosUtils.DecodeName(buffer, ref offset);
- Type = (NameRecordType)BigEndianReader.ReadUInt16(buffer, ref offset);
- Class = BigEndianReader.ReadUInt16(buffer, ref offset);
- }
- public void WriteBytes(Stream stream)
- {
- byte[] encodedName = NetBiosUtils.EncodeName(Name, String.Empty);
- ByteWriter.WriteBytes(stream, encodedName);
- BigEndianWriter.WriteUInt16(stream, (ushort)Type);
- BigEndianWriter.WriteUInt16(stream, Class);
- }
- }
- }
|