/* Copyright (C) 2014 Tal Aloni . All rights reserved. * * You can redistribute this program and/or modify it under the terms of * the GNU Lesser Public License as published by the Free Software Foundation, * either version 3 of the License, or (at your option) any later version. */ using System; using System.Collections.Generic; using System.Text; using Utilities; namespace SMBLibrary { /// /// [MS-DFSC] REQ_GET_DFS_REFERRAL /// public class RequestGetDfsReferral { public ushort MaxReferralLevel; public string RequestFileName; // Unicode public RequestGetDfsReferral() { } public RequestGetDfsReferral(byte[] buffer) { MaxReferralLevel = LittleEndianConverter.ToUInt16(buffer, 0); RequestFileName = ByteReader.ReadNullTerminatedUTF16String(buffer, 2); } public byte[] GetBytes() { int length = 2 + RequestFileName.Length * 2 + 2; byte[] buffer = new byte[length]; LittleEndianWriter.WriteUInt16(buffer, 0, MaxReferralLevel); ByteWriter.WriteUTF16String(buffer, 2, RequestFileName); return buffer; } } }