using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;
using skyscraper5.Docsis.AnnexC;
using skyscraper5.Skyscraper.IO;
using skyscraper5.Skyscraper.Plugins;

namespace skyscraper5.Docsis.MacManagement
{
	[SkyscraperPlugin]
	[MacManagementMessageType(2,16)]
    internal class DynamicServiceAdditionResponse : MacManagementMessage
    {
        public DynamicServiceAdditionResponse(PhysicalAddress source, PhysicalAddress destination, byte[] buffer) : base(source, destination, buffer)
        {
            MemoryStream ms = new MemoryStream(buffer, false);
            TransactionId = ms.ReadUInt16BE();
            ConfirmationCode = ms.ReadUInt8();
            TlvEncodedInformation = new CommonTlvEncodingObject(ms);
            Valid = true;
        }

        public CommonTlvEncodingObject TlvEncodedInformation { get; set; }

        public byte ConfirmationCode { get; set; }

        public ushort TransactionId { get; set; }
    }
}
