using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using skyscraper5.Mpeg2;
using skyscraper5.Skyscraper.IO;
using skyscraper5.Skyscraper.Plugins;

namespace skyscraper5.Dvb.SystemSoftwareUpdate.Descriptors
{
	[SkyscraperPlugin]
	[TsDescriptor(0x07,"UNT")]
    class TargetMacAddressDescriptor : TsDescriptor
    {
        public TargetMacAddressDescriptor(byte[] buffer)
        {
            MemoryStream ms = new MemoryStream(buffer, false);
            MacAddressMask = BitConverter.ToString(ms.ReadBytes(6));

            long numMacAddressMatches = ms.GetAvailableBytes() / 6;
            MacAddressMatches = new string[numMacAddressMatches];
            for (int i = 0; i < numMacAddressMatches; i++)
            {
                MacAddressMatches[i] = BitConverter.ToString(ms.ReadBytes(6));
            }
        }

        public string[] MacAddressMatches { get; private set; }

        public string MacAddressMask { get; set; }
    }
}
