using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace skyscraper5.Ietf.Rfc971
{
    public class TypeOfService
    {
        public TypeOfService(byte typeOfService)
        {
            Precedence = (PrecedenceEnum)((typeOfService & 0xe0) >> 5);
            LowDelay = (typeOfService & 0x10) != 0;
            HighThroughput = (typeOfService & 0x80) != 0;
            HighReliability = (typeOfService & 0x40) != 0;
        }


        public bool HighReliability { get; private set; }

        public bool HighThroughput { get; private set; }

        public bool LowDelay { get; private set; }

        public PrecedenceEnum Precedence { get; private set; }

        public enum PrecedenceEnum
        {
            Routine = 0,
            Priority = 1,
            Immediate = 2,
            Flash = 3,
            FlashOverride = 4,
            Critic = 5,
            InternetworkControl = 6,
            NetworkControl = 7
        }
    }
}
